OSDN Git Service

na-get-lib,AppliStation-GUI,レポジトリリスト編集機能追加
authorttp <ttp@users.sourceforge.jp>
Sun, 10 May 2009 12:29:12 +0000 (21:29 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 10 May 2009 12:29:12 +0000 (21:29 +0900)
 - ソフトリスト更新などを含め「整理」メニューに統合。
 - レポジトリリスト編集ダイアログ・メニュー追加

12 files changed:
AppliStation/AppliStation.Util/GUIUtils.cs
AppliStation/AppliStation.csproj
AppliStation/PackageListViewForm.Designer.cs
AppliStation/PackageListViewForm.cs
AppliStation/PackageListViewForm.resx
AppliStation/UserPrefForm.Designer.cs [new file with mode: 0644]
AppliStation/UserPrefForm.cs [new file with mode: 0644]
AppliStation/UserPrefForm.resx [new file with mode: 0644]
na-get-lib/NaGet.Packages/Package.cs
na-get-lib/NaGet.Packages/RepositoriesList.cs
na-get-lib/NaGet/NaGetLibPref.cs
na-get-lib/NaGet/Utils.cs

index d70989b..ed5a057 100644 (file)
@@ -3,6 +3,7 @@ using System.IO;
 using System.Runtime.InteropServices;\r
 using System.Drawing;\r
 using System.Drawing.Imaging;\r
+using System.Windows.Forms;\r
 using NaGet.Packages;\r
 using NaGet.Packages.Install;\r
 \r
@@ -13,6 +14,8 @@ namespace AppliStation.Util
        /// </summary>\r
        public sealed class GUIUtils\r
        {\r
+               #region アイコン関連\r
+               \r
                #region ExtraIcon関連\r
                \r
                [DllImport("shell32.dll")]\r
@@ -30,7 +33,7 @@ namespace AppliStation.Util
                /// <param name="lpszExeFileName">対象ファイル</param>\r
                /// <param name="nIconIndex">アイコンインデックス</param>\r
                /// <returns>生成されたアイコン</returns>\r
-               public static Icon ExtractIcon(System.Windows.Forms.Form form, string lpszExeFileName, uint nIconIndex)\r
+               public static Icon ExtractIcon(Form form, string lpszExeFileName, uint nIconIndex)\r
                {\r
                        Icon ico = null;\r
                        \r
@@ -59,7 +62,7 @@ namespace AppliStation.Util
                /// <param name="form">ハンドラ</param>\r
                /// <param name="lpszExeFileNameAndIndex">対象ファイルとアイコンインデックスの文字列表現</param>\r
                /// <returns>生成されたアイコン。</returns>\r
-               public static Icon ExtractIcon(System.Windows.Forms.Form form, string lpszExeFileNameAndIndex)\r
+               public static Icon ExtractIcon(Form form, string lpszExeFileNameAndIndex)\r
                {\r
                        int index = lpszExeFileNameAndIndex.LastIndexOf(',');\r
                        if (index >= 0) {\r
@@ -162,5 +165,29 @@ namespace AppliStation.Util
                                    GraphicsUnit.Pixel, ia);\r
                }\r
 \r
+               #endregion\r
+               \r
+               #region CheckedListBox関連\r
+               \r
+               /// <summary>\r
+               /// チェックリストボックスのアイテムをスワップする\r
+               /// </summary>\r
+               /// <param name="checkedListBox">操作対象のCheckedListBox</param>\r
+               /// <param name="indexA">アイテムインデックス</param>\r
+               /// <param name="indexB">アイテムインデックス</param>\r
+               /// <remarks>インデックス値のチェックは本メソッドでは行っていない</remarks>\r
+               public static void CheckedListBox_SwapItems(CheckedListBox checkedListBox, int indexA, int indexB) {\r
+                       int itemCount = checkedListBox.Items.Count;\r
+                       object tempItem          = checkedListBox.Items[indexA];\r
+                       CheckState tempState = checkedListBox.GetItemCheckState(indexA);\r
+                       \r
+                       checkedListBox.Items[indexA] = checkedListBox.Items[indexB];\r
+                       checkedListBox.SetItemCheckState(indexA, checkedListBox.GetItemCheckState(indexB));\r
+                       \r
+                       checkedListBox.Items[indexB] = tempItem;\r
+                       checkedListBox.SetItemCheckState(indexB, tempState);\r
+               }\r
+               \r
+               #endregion\r
        }\r
 }\r
index 8f0a982..308fac7 100644 (file)
       <DependentUpon>PackageUninstallConfirmForm.cs</DependentUpon>\r
     </Compile>\r
     <Compile Include="Program.cs" />\r
+    <Compile Include="UserPrefForm.cs" />\r
+    <Compile Include="UserPrefForm.Designer.cs">\r
+      <DependentUpon>UserPrefForm.cs</DependentUpon>\r
+    </Compile>\r
     <EmbeddedResource Include="AppliStation.Util\ExceptionDialogForm.resx">\r
       <DependentUpon>ExceptionDialogForm.Designer.cs</DependentUpon>\r
     </EmbeddedResource>\r
     <EmbeddedResource Include="PackageUninstallConfirmForm.resx">\r
       <DependentUpon>PackageUninstallConfirmForm.cs</DependentUpon>\r
     </EmbeddedResource>\r
+    <EmbeddedResource Include="UserPrefForm.resx">\r
+      <DependentUpon>UserPrefForm.cs</DependentUpon>\r
+    </EmbeddedResource>\r
     <None Include="AppliStation.ico" />\r
     <None Include="SplashScreen.png">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
index 72eafc1..e74f40a 100644 (file)
@@ -41,8 +41,9 @@
                        this.installedSysPackageFilterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.searchTextBox = new AppliStation.Util.ToolStripWeb2LikeTextBox();\r
                        this.packageCommandsToolStrip = new System.Windows.Forms.ToolStrip();\r
-                       this.updateToolStripButton = new System.Windows.Forms.ToolStripSplitButton();\r
-                       this.localUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.organizeToolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();\r
+                       this.updateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.localupdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.upgradeToolStripButton = new System.Windows.Forms.ToolStripButton();\r
                        this.informationToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton();\r
                        this.packageListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);\r
@@ -62,6 +63,8 @@
                        this.summaryHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.packageListViewImageList = new System.Windows.Forms.ImageList(this.components);\r
                        this.detailBox = new System.Windows.Forms.RichTextBox();\r
+                       this.organizeToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
+                       this.optionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.tableLayoutPanel1.SuspendLayout();\r
                        this.toolStripContainer.SuspendLayout();\r
                        this.packageListFilterToolStrip.SuspendLayout();\r
                        // \r
                        this.packageCommandsToolStrip.Dock = System.Windows.Forms.DockStyle.None;\r
                        this.packageCommandsToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
-                                                                       this.updateToolStripButton,\r
+                                                                       this.organizeToolStripDropDownButton1,\r
                                                                        this.upgradeToolStripButton,\r
                                                                        this.informationToolStripDropDownButton,\r
                                                                        this.installToolStripButton,\r
                                                                        this.uninstallToolStripButton});\r
                        this.packageCommandsToolStrip.Location = new System.Drawing.Point(3, 25);\r
                        this.packageCommandsToolStrip.Name = "packageCommandsToolStrip";\r
-                       this.packageCommandsToolStrip.Size = new System.Drawing.Size(221, 25);\r
+                       this.packageCommandsToolStrip.Size = new System.Drawing.Size(478, 25);\r
                        this.packageCommandsToolStrip.TabIndex = 2;\r
                        // \r
-                       // updateToolStripButton\r
+                       // organizeToolStripDropDownButton1\r
                        // \r
-                       this.updateToolStripButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
-                                                                       this.localUpdateToolStripMenuItem});\r
-                       this.updateToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("updateToolStripButton.Image")));\r
-                       this.updateToolStripButton.Name = "updateToolStripButton";\r
-                       this.updateToolStripButton.Size = new System.Drawing.Size(111, 22);\r
-                       this.updateToolStripButton.Text = "リストの更新(&U)";\r
-                       this.updateToolStripButton.ToolTipText = "ソフトリストを更新します";\r
-                       this.updateToolStripButton.ButtonClick += new System.EventHandler(this.UpdateToolStripButtonClick);\r
+                       this.organizeToolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+                                                                       this.updateToolStripMenuItem,\r
+                                                                       this.localupdateToolStripMenuItem,\r
+                                                                       this.organizeToolStripSeparator1,\r
+                                                                       this.optionToolStripMenuItem});\r
+                       this.organizeToolStripDropDownButton1.Name = "organizeToolStripDropDownButton1";\r
+                       this.organizeToolStripDropDownButton1.Size = new System.Drawing.Size(58, 22);\r
+                       this.organizeToolStripDropDownButton1.Text = "整理(&O)";\r
                        // \r
-                       // localUpdateToolStripMenuItem\r
+                       // updateToolStripMenuItem\r
                        // \r
-                       this.localUpdateToolStripMenuItem.Name = "localUpdateToolStripMenuItem";\r
-                       this.localUpdateToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;\r
-                       this.localUpdateToolStripMenuItem.Size = new System.Drawing.Size(256, 22);\r
-                       this.localUpdateToolStripMenuItem.Text = "インストール済ソフトの読み直し(&R)";\r
-                       this.localUpdateToolStripMenuItem.Click += new System.EventHandler(this.LocalupdateToolStripMenuItemClick);\r
+                       this.updateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("updateToolStripMenuItem.Image")));\r
+                       this.updateToolStripMenuItem.Name = "updateToolStripMenuItem";\r
+                       this.updateToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F5)));\r
+                       this.updateToolStripMenuItem.Size = new System.Drawing.Size(256, 22);\r
+                       this.updateToolStripMenuItem.Text = "リストの更新(&U)";\r
+                       this.updateToolStripMenuItem.ToolTipText = "ソフトリストを更新します";\r
+                       this.updateToolStripMenuItem.Click += new System.EventHandler(this.UpdateToolStripMenuItemClick);\r
+                       // \r
+                       // localupdateToolStripMenuItem\r
+                       // \r
+                       this.localupdateToolStripMenuItem.Name = "localupdateToolStripMenuItem";\r
+                       this.localupdateToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;\r
+                       this.localupdateToolStripMenuItem.Size = new System.Drawing.Size(256, 22);\r
+                       this.localupdateToolStripMenuItem.Text = "インストール済ソフトの読み直し(&R)";\r
+                       this.localupdateToolStripMenuItem.Click += new System.EventHandler(this.LocalupdateToolStripMenuItemClick);\r
                        // \r
                        // upgradeToolStripButton\r
                        // \r
                                                                        this.installedDirectoryStripMenuItem,\r
                                                                        this.propertiesToolStripMenuItem});\r
                        this.packageListContextMenuStrip.Name = "packageListContextMenuStrip";\r
-                       this.packageListContextMenuStrip.OwnerItem = this.informationToolStripDropDownButton;\r
                        this.packageListContextMenuStrip.Size = new System.Drawing.Size(205, 120);\r
                        this.packageListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.PackageListContextMenuStripOpening);\r
                        // \r
                        this.detailBox.Text = "";\r
                        this.detailBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.DetailBoxLinkClicked);\r
                        // \r
+                       // organizeToolStripSeparator1\r
+                       // \r
+                       this.organizeToolStripSeparator1.Name = "organizeToolStripSeparator1";\r
+                       this.organizeToolStripSeparator1.Size = new System.Drawing.Size(253, 6);\r
+                       // \r
+                       // optionToolStripMenuItem\r
+                       // \r
+                       this.optionToolStripMenuItem.Name = "optionToolStripMenuItem";\r
+                       this.optionToolStripMenuItem.Size = new System.Drawing.Size(256, 22);\r
+                       this.optionToolStripMenuItem.Text = "設定(&O)...";\r
+                       this.optionToolStripMenuItem.Click += new System.EventHandler(this.OptionToolStripMenuItemClick);\r
+                       // \r
                        // PackageListViewForm\r
                        // \r
                        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
                        this.splitContainer.ResumeLayout(false);\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.ToolStripMenuItem optionToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripSeparator organizeToolStripSeparator1;\r
+               private System.Windows.Forms.ToolStripMenuItem localupdateToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripMenuItem updateToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripDropDownButton organizeToolStripDropDownButton1;\r
                private System.Windows.Forms.ImageList packageListViewImageList;\r
                private System.Windows.Forms.ToolStripDropDownButton informationToolStripDropDownButton;\r
                private System.Windows.Forms.ToolStripSeparator packageListContextMenuStripSeparator;\r
                private System.Windows.Forms.ToolStripMenuItem allPackageFilterToolStripMenuItem;\r
                private System.Windows.Forms.ToolStripDropDownButton packageFilterToolStripDropDownButton;\r
                private System.Windows.Forms.ToolStripButton upgradeToolStripButton;\r
-               private System.Windows.Forms.ToolStripMenuItem localUpdateToolStripMenuItem;\r
-               private System.Windows.Forms.ToolStripSplitButton updateToolStripButton;\r
                private System.Windows.Forms.ToolStripMenuItem uninstallToolStripMenuItem;\r
                private System.Windows.Forms.ToolStripMenuItem installToolStripMenuItem;\r
                private System.Windows.Forms.ContextMenuStrip packageListContextMenuStrip;\r
index 3870284..70922da 100644 (file)
@@ -337,7 +337,7 @@ namespace AppliStation
                        prog.ShowDialog(this);\r
                }\r
                        \r
-               void UpdateToolStripButtonClick(object sender, EventArgs e)\r
+               void UpdateToolStripMenuItemClick(object sender, EventArgs e)\r
                {\r
                        updateActionInvoke(true);\r
                        \r
@@ -351,6 +351,19 @@ namespace AppliStation
                        UpdatePackageList();\r
                }\r
                \r
+               void OptionToolStripMenuItemClick(object sender, EventArgs e)\r
+               {\r
+                       UserPrefForm userPrefForm = new UserPrefForm();\r
+                       DialogResult result = userPrefForm.ShowDialog(this);\r
+                       \r
+                       if (result == DialogResult.OK) {\r
+                               if (userPrefForm.IsRepositoryListSettingChanged) {\r
+                                       updateActionInvoke(true);\r
+                                       UpdatePackageList();\r
+                               }\r
+                       }\r
+               }\r
+               \r
                #region searchTextBoxまわり\r
                \r
                void SearchTextBoxKeyPress(object sender, KeyPressEventArgs e)\r
@@ -438,8 +451,7 @@ namespace AppliStation
                                \r
                                if (File.Exists(tmpfileName)) {\r
                                        File.Delete(tmpfileName);\r
-                               }\r
-                               this.setWindowEnabled(true);\r
+                               }                               this.setWindowEnabled(true);\r
                        }\r
                }\r
                \r
index e5d2a56..ca0b60e 100644 (file)
     <value>314, 17</value>\r
   </metadata>\r
   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
-  <data name="updateToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+  <data name="updateToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\r
         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAyBJREFUOE9dU1lM\r
   <data name="informationToolStripDropDownButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\r
-        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAA\r
-        CxEBf2RfkQAAASNJREFUOE+VkztrhUAQhZPfmCLaWgQUe0uxsJcLt7DQOsQIFrGx9lWkErGysBTf/2By\r
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEAAA\r
+        CxABrSO9dQAAASNJREFUOE+VkztrhUAQhZPfmCLaWgQUe0uxsJcLt7DQOsQIFrGx9lWkErGysBTf/2By\r
         z4aV3BA1LnysLjvnzOzsPj7chm3b723bPuH7xHjWdf2N7TcMg84OxKxmXGAYBuq6jtH3/QrWwTiOtCwL\r
         8/pTAIFxHFOSJIw0Te/IsuxYgDvLskycoiiY+zRN+wII5s5BEJAgCCvI5jADCMAVjqgZ83cWL+z/Xxlw\r
         V56BoigEiuLzWAAuP2vnwXyuqmr/DCDwu3ZkJIoiSZJEqqpSXdfbbeS9Rq1gnmcqy5I0TSPTNMmyLHIc\r
     <value>\r
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w\r
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0\r
-        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACC\r
+        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACA\r
         BQAAAk1TRnQBSQFMAwEBAAEEAQABBAEAARABAAEQAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA\r
-        ARADAAEBAQABIAYAARD/AC8AAZcCFwFkA9UB/wPiAf8D1gH/A8gB/wGZAhUBXwQAAdECAAEC3AABlgKC\r
-        AecDxwH/A9QB/wPhAf8DzwH/A70B/wO2Af8DsAH/AawCCQE6AcICAgEX2AABmQKAAeEDvwH/A8kB/wLS\r
-        AdQB/wPGAf8DogH/A4QB/wGIAnsB7wHBAgIBGAHEAgEBE8QAAZ4BmwGZAf8C4AHhAf8BSQJGAfsBnQKX\r
-        AfgBkQIdAXMEAAGkAg0BSQGNAn8B7gJ0AXIB/wFxAW4BcQH/AZ4BnwGhAf8BtwHHAcsB/wHPAekB7AH/\r
-        AtMB1AH/yAABwAG6AbsB/wGtAqwB/wGqAqkB/wPXAf8BaAJOAeEBawFfAWIB8QGxAcIBxwH/AawByAHO\r
+        ARADAAEBAQABIAYAARD/AC8AAckCBAFkA9UB/wPiAf8D1gH/A8gB/wHKAgMBXwQAAdMCAAEC3AABoAJr\r
+        AecDxwH/A9QB/wPhAf8DzwH/A70B/wO2Af8DsAH/AdECAAE6AdMCAAEX2AABpAJkAeEDvwH/A8kB/wLS\r
+        AdQB/wPGAf8DogH/A4QB/wGPAmsB7wHTAgABGAHTAgABE8QAAZ4BmwGZAf8C4AHhAf8BTQJEAfsBoQKP\r
+        AfgBxgIGAXMEAAHQAgEBSQGVAm4B7gJ0AXIB/wFxAW4BcQH/AZ4BnwGhAf8BtwHHAcsB/wHPAekB7AH/\r
+        AtMB1AH/yAABwAG6AbsB/wGtAqwB/wGqAqkB/wPXAf8BfwI9AeEBdgFUAVgB8QGxAcIBxwH/AawByAHO\r
         Af8BvQHGAcgB/wHHAawBqgH/AcUBZgFWAf8BrwECAQAB/wGZAgAB/wHDAeAB5AH/yAAB0gHNAcwB/wGu\r
         AawBrwH/A5cB/wGnAbUBtgH/AboCpwH/AaIBTQFPAf8BjgEOAQ0B/wGBAgAB/wGNAgAB/wGvAS4BGgH/\r
         AbsBOQEmAf8BwgE+ASoB/wHIASYBDQH/AcYB6QHtAf/IAAHeAdYB2AH/Aa4BsAGuAf8DoAH/AYEBKAEk\r
         Af8BjQESAQYB/wGLARQBCQH/AZABDQEAAf8BsQGnAaUB/wFzARsBEwH/AdEBYgFPAf8B1wFfAUsB/wHd\r
-        AWQBTwH/AeYBXAFEAf8B0AHlAeYB/wGzAgYBLsQAAdECzQH/AbICsQH/A7MB/wGaAXMBdgH/AZ4BNwEv\r
+        AWQBTwH/AeYBXAFEAf8B0AHlAeYB/wHSAgABLsQAAdECzQH/AbICsQH/A7MB/wGaAXMBdgH/AZ4BNwEv\r
         Af8BlwEuASQB/wHXAcwBywH/AZsBYAFYAf8D3wH/AeIBjwGCAf8B6QGHAXIB/wHuAYoBdgH/AfMBjwF2\r
-        Af8B1QHSAdEB/wGaAhQBXcQAAa8BqgGoAf8BvQG0AbsB/wG/Ab0BvwH/AbABtgG6Af8BrgFTAUwB/wGV\r
+        Af8B1QHSAdEB/wHLAgMBXcQAAa8BqgGoAf8BvQG0AbsB/wG/Ab0BvwH/AbABtgG6Af8BrgFTAUwB/wGV\r
         ARYBDwH/AZQBMwElAf8BtwEUAQAB/wGzAWUBYgH/AbkBsAGuAf8B9QGoAZkB/wH6Aa0BnAL/AbEBpQH/\r
-        Ae0BvwG3Af8BjAIkAYHFAAF4ATYB/wHYAcQB0AH/A8oB/wG8Ac4B0QH/Ab4BbQFlAf8BmwIAAf8BvgEW\r
-        AQAB/wHWASEBAAH/AfABKQEBAf8B4AHdAdwB/wGnAYoBggL/AcwBvAL/AdUBxQH/AfQBwwGtAf8BgwJp\r
+        Ae0BvwG3Af8BwQIJAYHFAAF4ATYB/wHYAcQB0AH/A8oB/wG8Ac4B0QH/Ab4BbQFlAf8BmwIAAf8BvgEW\r
+        AQAB/wHWASEBAAH/AfABKQEBAf8B4AHdAdwB/wGnAYoBggL/AcwBvAL/AdUBxQH/AfQBwwGtAf8BlQJQ\r
         AeDEAAF3AXEBdAH/AfUB9gH5Af8D4QH/AcEB0gHXAf8BoQElARYB/wGvARQBAAH/AccBGgEAAf8B3wEj\r
-        AQAB/wH7AXQBWgH/AfgB1QHIAf8D1AH/AckBswGoAv8B5AHbAv8BygGzAf8BmwGdAaAB/8gAAcICAgEX\r
-        AYECRgG4AcMBzwHSAf8BjQIAAf8BtQEZAQAB/wHPAR0BAAH/AeYBFQEAAv8B4gHXAv8B7QHpAf8B7gHi\r
-        AdoB/wHsAdsB0gL/AeUB1QH/AfsBuwGeAf8BsQG6AbwB/9AAAZQCGwFtAYUCAAH/AbMBBQEAAf8BvwEp\r
-        ARcB/wHWAVQBQgH/AdUBrgGkAf8B0AG1Aa8B/wHHAsoB/wHKAdEB1AH/AYkBZAFlAc0BiQItAY8BoAIQ\r
-        AVHQAAHJAgABDAGIAVMBVgG+AZQCGgFrAa0CCAE4Ab0CAwEe/wDdAAFCAU0BPgcAAT4DAAEoAwABQAMA\r
-        ARADAAEBAQABAQUAAYAXAAP/AQAC/wYAAf4BBQYAAfwHAAH8BwABggEBBgABgAEBBgABgAEBBgABgAcA\r
-        AYAHAAGABwABgAcAAYAHAAHABwAB8AcAAfABfwYAAv8GAAs=\r
+        AQAB/wH7AXQBWgH/AfgB1QHIAf8D1AH/AckBswGoAv8B5AHbAv8BygGzAf8BmwGdAaAB/8gAAdMCAAEX\r
+        AagCJQG4AcMBzwHSAf8BjQIAAf8BtQEZAQAB/wHPAR0BAAH/AeYBFQEAAv8B4gHXAv8B7QHpAf8B7gHi\r
+        AdoB/wHsAdsB0gL/AeUB1QH/AfsBuwGeAf8BsQG6AbwB/9AAAcgCBQFtAYUCAAH/AbMBBQEAAf8BvwEp\r
+        ARcB/wHWAVQBQgH/AdUBrgGkAf8B0AG1Aa8B/wHHAsoB/wHKAdEB1AH/AaICQAHNAbwCDQGPAc4CAgFR\r
+        0AAB0wIAAQwBqQEtAS8BvgHHAgUBawHSAgABOAHSAgABHv8A3QABQgFNAT4HAAE+AwABKAMAAUADAAEQ\r
+        AwABAQEAAQEFAAGAFwAD/wEAAv8GAAH+AQUGAAH8BwAB/AcAAYIBAQYAAYABAQYAAYABAQYAAYAHAAGA\r
+        BwABgAcAAYAHAAGABwABwAcAAfAHAAHwAX8GAAL/BgAL\r
 </value>\r
   </data>\r
 </root>
\ No newline at end of file
diff --git a/AppliStation/UserPrefForm.Designer.cs b/AppliStation/UserPrefForm.Designer.cs
new file mode 100644 (file)
index 0000000..0edb0b7
--- /dev/null
@@ -0,0 +1,281 @@
+namespace AppliStation\r
+{\r
+       partial class UserPrefForm\r
+       {\r
+               /// <summary>\r
+               /// Designer variable used to keep track of non-visual components.\r
+               /// </summary>\r
+               private System.ComponentModel.IContainer components = null;\r
+               \r
+               /// <summary>\r
+               /// Disposes resources used by the form.\r
+               /// </summary>\r
+               /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+               protected override void Dispose(bool disposing)\r
+               {\r
+                       if (disposing) {\r
+                               if (components != null) {\r
+                                       components.Dispose();\r
+                               }\r
+                       }\r
+                       base.Dispose(disposing);\r
+               }\r
+               \r
+               /// <summary>\r
+               /// This method is required for Windows Forms designer support.\r
+               /// Do not change the method contents inside the source code editor. The Forms designer might\r
+               /// not be able to load this method if it was changed manually.\r
+               /// </summary>\r
+               private void InitializeComponent()\r
+               {\r
+                       this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
+                       this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r
+                       this.okButton = new System.Windows.Forms.Button();\r
+                       this.cancelButton = new System.Windows.Forms.Button();\r
+                       this.tabControl = new System.Windows.Forms.TabControl();\r
+                       this.reposListTabPage = new System.Windows.Forms.TabPage();\r
+                       this.repoTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
+                       this.repoListCheckedListBox = new System.Windows.Forms.CheckedListBox();\r
+                       this.repoBtnsFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();\r
+                       this.addRepoButton = new System.Windows.Forms.Button();\r
+                       this.removeRepoButton = new System.Windows.Forms.Button();\r
+                       this.upRepoButton = new System.Windows.Forms.Button();\r
+                       this.downRepoButton = new System.Windows.Forms.Button();\r
+                       this.repoUrlTextBox = new System.Windows.Forms.TextBox();\r
+                       this.repoUrlLabel = new System.Windows.Forms.Label();\r
+                       this.tableLayoutPanel.SuspendLayout();\r
+                       this.flowLayoutPanel1.SuspendLayout();\r
+                       this.tabControl.SuspendLayout();\r
+                       this.reposListTabPage.SuspendLayout();\r
+                       this.repoTableLayoutPanel.SuspendLayout();\r
+                       this.repoBtnsFlowLayoutPanel.SuspendLayout();\r
+                       this.SuspendLayout();\r
+                       // \r
+                       // tableLayoutPanel\r
+                       // \r
+                       this.tableLayoutPanel.ColumnCount = 1;\r
+                       this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.tableLayoutPanel.Controls.Add(this.flowLayoutPanel1, 0, 1);\r
+                       this.tableLayoutPanel.Controls.Add(this.tabControl, 0, 0);\r
+                       this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);\r
+                       this.tableLayoutPanel.Name = "tableLayoutPanel";\r
+                       this.tableLayoutPanel.RowCount = 1;\r
+                       this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));\r
+                       this.tableLayoutPanel.Size = new System.Drawing.Size(492, 226);\r
+                       this.tableLayoutPanel.TabIndex = 1;\r
+                       // \r
+                       // flowLayoutPanel1\r
+                       // \r
+                       this.flowLayoutPanel1.AutoSize = true;\r
+                       this.flowLayoutPanel1.Controls.Add(this.okButton);\r
+                       this.flowLayoutPanel1.Controls.Add(this.cancelButton);\r
+                       this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Right;\r
+                       this.flowLayoutPanel1.Location = new System.Drawing.Point(322, 193);\r
+                       this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);\r
+                       this.flowLayoutPanel1.Name = "flowLayoutPanel1";\r
+                       this.flowLayoutPanel1.Size = new System.Drawing.Size(170, 33);\r
+                       this.flowLayoutPanel1.TabIndex = 14;\r
+                       // \r
+                       // okButton\r
+                       // \r
+                       this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
+                       this.okButton.AutoSize = true;\r
+                       this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;\r
+                       this.okButton.Location = new System.Drawing.Point(5, 5);\r
+                       this.okButton.Margin = new System.Windows.Forms.Padding(5);\r
+                       this.okButton.Name = "okButton";\r
+                       this.okButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.okButton.TabIndex = 0;\r
+                       this.okButton.Text = "OK";\r
+                       this.okButton.Click += new System.EventHandler(this.OkButtonClick);\r
+                       // \r
+                       // cancelButton\r
+                       // \r
+                       this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
+                       this.cancelButton.AutoSize = true;\r
+                       this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\r
+                       this.cancelButton.Location = new System.Drawing.Point(90, 5);\r
+                       this.cancelButton.Margin = new System.Windows.Forms.Padding(5);\r
+                       this.cancelButton.Name = "cancelButton";\r
+                       this.cancelButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.cancelButton.TabIndex = 1;\r
+                       this.cancelButton.Text = "キャンセル";\r
+                       this.cancelButton.Click += new System.EventHandler(this.CancelButtonClick);\r
+                       // \r
+                       // tabControl\r
+                       // \r
+                       this.tabControl.Controls.Add(this.reposListTabPage);\r
+                       this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.tabControl.Location = new System.Drawing.Point(5, 5);\r
+                       this.tabControl.Margin = new System.Windows.Forms.Padding(5);\r
+                       this.tabControl.Multiline = true;\r
+                       this.tabControl.Name = "tabControl";\r
+                       this.tabControl.SelectedIndex = 0;\r
+                       this.tabControl.Size = new System.Drawing.Size(482, 183);\r
+                       this.tabControl.TabIndex = 1;\r
+                       // \r
+                       // reposListTabPage\r
+                       // \r
+                       this.reposListTabPage.Controls.Add(this.repoTableLayoutPanel);\r
+                       this.reposListTabPage.Location = new System.Drawing.Point(4, 21);\r
+                       this.reposListTabPage.Name = "reposListTabPage";\r
+                       this.reposListTabPage.Padding = new System.Windows.Forms.Padding(3);\r
+                       this.reposListTabPage.Size = new System.Drawing.Size(474, 158);\r
+                       this.reposListTabPage.TabIndex = 0;\r
+                       this.reposListTabPage.Text = "レポジトリ";\r
+                       // \r
+                       // repoTableLayoutPanel\r
+                       // \r
+                       this.repoTableLayoutPanel.ColumnCount = 2;\r
+                       this.repoTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
+                       this.repoTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.repoTableLayoutPanel.Controls.Add(this.repoListCheckedListBox, 0, 0);\r
+                       this.repoTableLayoutPanel.Controls.Add(this.repoBtnsFlowLayoutPanel, 0, 1);\r
+                       this.repoTableLayoutPanel.Controls.Add(this.repoUrlTextBox, 1, 2);\r
+                       this.repoTableLayoutPanel.Controls.Add(this.repoUrlLabel, 0, 2);\r
+                       this.repoTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.repoTableLayoutPanel.Location = new System.Drawing.Point(3, 3);\r
+                       this.repoTableLayoutPanel.Name = "repoTableLayoutPanel";\r
+                       this.repoTableLayoutPanel.RowCount = 3;\r
+                       this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.repoTableLayoutPanel.Size = new System.Drawing.Size(468, 152);\r
+                       this.repoTableLayoutPanel.TabIndex = 1;\r
+                       // \r
+                       // repoListCheckedListBox\r
+                       // \r
+                       this.repoListCheckedListBox.CheckOnClick = true;\r
+                       this.repoTableLayoutPanel.SetColumnSpan(this.repoListCheckedListBox, 2);\r
+                       this.repoListCheckedListBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.repoListCheckedListBox.FormattingEnabled = true;\r
+                       this.repoListCheckedListBox.IntegralHeight = false;\r
+                       this.repoListCheckedListBox.Location = new System.Drawing.Point(3, 3);\r
+                       this.repoListCheckedListBox.Name = "repoListCheckedListBox";\r
+                       this.repoListCheckedListBox.ScrollAlwaysVisible = true;\r
+                       this.repoListCheckedListBox.Size = new System.Drawing.Size(462, 86);\r
+                       this.repoListCheckedListBox.TabIndex = 0;\r
+                       this.repoListCheckedListBox.SelectedIndexChanged += new System.EventHandler(this.RepoListCheckedListBoxSelectedIndexChanged);\r
+                       this.repoListCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.RepoListCheckedListBoxItemCheck);\r
+                       // \r
+                       // repoBtnsFlowLayoutPanel\r
+                       // \r
+                       this.repoBtnsFlowLayoutPanel.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
+                       this.repoBtnsFlowLayoutPanel.AutoSize = true;\r
+                       this.repoTableLayoutPanel.SetColumnSpan(this.repoBtnsFlowLayoutPanel, 2);\r
+                       this.repoBtnsFlowLayoutPanel.Controls.Add(this.addRepoButton);\r
+                       this.repoBtnsFlowLayoutPanel.Controls.Add(this.removeRepoButton);\r
+                       this.repoBtnsFlowLayoutPanel.Controls.Add(this.upRepoButton);\r
+                       this.repoBtnsFlowLayoutPanel.Controls.Add(this.downRepoButton);\r
+                       this.repoBtnsFlowLayoutPanel.Location = new System.Drawing.Point(141, 95);\r
+                       this.repoBtnsFlowLayoutPanel.Name = "repoBtnsFlowLayoutPanel";\r
+                       this.repoBtnsFlowLayoutPanel.Size = new System.Drawing.Size(324, 29);\r
+                       this.repoBtnsFlowLayoutPanel.TabIndex = 1;\r
+                       // \r
+                       // addRepoButton\r
+                       // \r
+                       this.addRepoButton.Location = new System.Drawing.Point(3, 3);\r
+                       this.addRepoButton.Name = "addRepoButton";\r
+                       this.addRepoButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.addRepoButton.TabIndex = 0;\r
+                       this.addRepoButton.Text = "新規";\r
+                       this.addRepoButton.Click += new System.EventHandler(this.AddRepoButtonClick);\r
+                       // \r
+                       // removeRepoButton\r
+                       // \r
+                       this.removeRepoButton.Enabled = false;\r
+                       this.removeRepoButton.Location = new System.Drawing.Point(84, 3);\r
+                       this.removeRepoButton.Name = "removeRepoButton";\r
+                       this.removeRepoButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.removeRepoButton.TabIndex = 1;\r
+                       this.removeRepoButton.Text = "削除";\r
+                       this.removeRepoButton.Click += new System.EventHandler(this.RemoveRepoButtonClick);\r
+                       // \r
+                       // upRepoButton\r
+                       // \r
+                       this.upRepoButton.Enabled = false;\r
+                       this.upRepoButton.Location = new System.Drawing.Point(165, 3);\r
+                       this.upRepoButton.Name = "upRepoButton";\r
+                       this.upRepoButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.upRepoButton.TabIndex = 2;\r
+                       this.upRepoButton.Text = "上へ";\r
+                       this.upRepoButton.Click += new System.EventHandler(this.UpRepoButtonClick);\r
+                       // \r
+                       // downRepoButton\r
+                       // \r
+                       this.downRepoButton.Enabled = false;\r
+                       this.downRepoButton.Location = new System.Drawing.Point(246, 3);\r
+                       this.downRepoButton.Name = "downRepoButton";\r
+                       this.downRepoButton.Size = new System.Drawing.Size(75, 23);\r
+                       this.downRepoButton.TabIndex = 3;\r
+                       this.downRepoButton.Text = "下へ";\r
+                       this.downRepoButton.Click += new System.EventHandler(this.DownRepoButtonClick);\r
+                       // \r
+                       // repoUrlTextBox\r
+                       // \r
+                       this.repoUrlTextBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.repoUrlTextBox.Enabled = false;\r
+                       this.repoUrlTextBox.ImeMode = System.Windows.Forms.ImeMode.Off;\r
+                       this.repoUrlTextBox.Location = new System.Drawing.Point(108, 130);\r
+                       this.repoUrlTextBox.Name = "repoUrlTextBox";\r
+                       this.repoUrlTextBox.Size = new System.Drawing.Size(357, 19);\r
+                       this.repoUrlTextBox.TabIndex = 2;\r
+                       this.repoUrlTextBox.Leave += new System.EventHandler(this.RepoUrlTextBoxLeave);\r
+                       // \r
+                       // repoUrlLabel\r
+                       // \r
+                       this.repoUrlLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));\r
+                       this.repoUrlLabel.AutoSize = true;\r
+                       this.repoUrlLabel.Enabled = false;\r
+                       this.repoUrlLabel.Location = new System.Drawing.Point(3, 133);\r
+                       this.repoUrlLabel.Name = "repoUrlLabel";\r
+                       this.repoUrlLabel.Size = new System.Drawing.Size(99, 12);\r
+                       this.repoUrlLabel.TabIndex = 1;\r
+                       this.repoUrlLabel.Text = "レポジトリのURL(&U):";\r
+                       // \r
+                       // UserPrefForm\r
+                       // \r
+                       this.AcceptButton = this.okButton;\r
+                       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
+                       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+                       this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\r
+                       this.CancelButton = this.cancelButton;\r
+                       this.ClientSize = new System.Drawing.Size(492, 226);\r
+                       this.Controls.Add(this.tableLayoutPanel);\r
+                       this.MaximizeBox = false;\r
+                       this.MinimizeBox = false;\r
+                       this.Name = "UserPrefForm";\r
+                       this.ShowIcon = false;\r
+                       this.ShowInTaskbar = false;\r
+                       this.Text = "設定";\r
+                       this.tableLayoutPanel.ResumeLayout(false);\r
+                       this.tableLayoutPanel.PerformLayout();\r
+                       this.flowLayoutPanel1.ResumeLayout(false);\r
+                       this.flowLayoutPanel1.PerformLayout();\r
+                       this.tabControl.ResumeLayout(false);\r
+                       this.reposListTabPage.ResumeLayout(false);\r
+                       this.repoTableLayoutPanel.ResumeLayout(false);\r
+                       this.repoTableLayoutPanel.PerformLayout();\r
+                       this.repoBtnsFlowLayoutPanel.ResumeLayout(false);\r
+                       this.ResumeLayout(false);\r
+               }\r
+               private System.Windows.Forms.TextBox repoUrlTextBox;\r
+               private System.Windows.Forms.Label repoUrlLabel;\r
+               private System.Windows.Forms.Button downRepoButton;\r
+               private System.Windows.Forms.Button upRepoButton;\r
+               private System.Windows.Forms.Button removeRepoButton;\r
+               private System.Windows.Forms.Button addRepoButton;\r
+               private System.Windows.Forms.FlowLayoutPanel repoBtnsFlowLayoutPanel;\r
+               private System.Windows.Forms.TableLayoutPanel repoTableLayoutPanel;\r
+               private System.Windows.Forms.CheckedListBox repoListCheckedListBox;\r
+               private System.Windows.Forms.TabPage reposListTabPage;\r
+               private System.Windows.Forms.TabControl tabControl;\r
+               private System.Windows.Forms.Button okButton;\r
+               private System.Windows.Forms.Button cancelButton;\r
+               private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\r
+               private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;\r
+       }\r
+}\r
diff --git a/AppliStation/UserPrefForm.cs b/AppliStation/UserPrefForm.cs
new file mode 100644 (file)
index 0000000..c08a7e3
--- /dev/null
@@ -0,0 +1,177 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Drawing;\r
+using System.Windows.Forms;\r
+\r
+using NaGet.Packages;\r
+\r
+namespace AppliStation\r
+{\r
+       /// <summary>\r
+       /// ユーザ設定用フォーム\r
+       /// </summary>\r
+       public partial class UserPrefForm : Form\r
+       {\r
+               private List<RepositoryInfo> repos;\r
+               \r
+               private bool isRepositoriesChanged;\r
+               \r
+               public UserPrefForm()\r
+               {\r
+                       repos = new List<RepositoryInfo>();\r
+                       \r
+                       InitializeComponent();\r
+                       \r
+                       loadCurrentPref();\r
+               }\r
+               \r
+               /// <summary>\r
+               /// 現在の設定を読み込む\r
+               /// </summary>\r
+               public void loadCurrentPref()\r
+               {\r
+                       this.RepositoriesListSetting = NaGet.Utils.GetDeserializedObject<RepositoriesList>(NaGet.Env.RepositoriesListFile);\r
+               }\r
+               \r
+               public RepositoriesList RepositoriesListSetting {\r
+                       get {\r
+                               RepositoriesList repoList = new RepositoriesList();\r
+                               repoList.Repositories = repos.ToArray();\r
+                               return repoList;\r
+                       }\r
+                       set {\r
+                               repos.Clear();\r
+                               repos.AddRange(value.Repositories);\r
+                               isRepositoriesChanged = false;\r
+                               \r
+                               updateRepos();\r
+                       }\r
+               }\r
+               \r
+               private void updateRepos()\r
+               {\r
+                       repoListCheckedListBox.Items.Clear();\r
+                       \r
+                       foreach (RepositoryInfo repo in repos) {\r
+                               string label = repoListCheckedListBoxRenderer(repo);\r
+                               repoListCheckedListBox.Items.Add(label, repo.Enabled);\r
+                       }\r
+               }\r
+               \r
+               public string repoListCheckedListBoxRenderer(RepositoryInfo repo)\r
+               {\r
+                       return string.Format("{0}[{1}]", repo.Name, repo.Url.Href);\r
+               }\r
+               \r
+               \r
+               void RepoListCheckedListBoxSelectedIndexChanged(object sender, EventArgs e)\r
+               {\r
+                       int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
+                       bool selected = (selectedIndex >= 0);\r
+                       \r
+                       removeRepoButton.Enabled        = selected;\r
+                       upRepoButton.Enabled            = selected && ((1 <= selectedIndex) && (selectedIndex < repos.Count));\r
+                       downRepoButton.Enabled          = selected && ((0 <= selectedIndex) && (selectedIndex < (repos.Count-1)));\r
+                       repoUrlLabel.Enabled            = selected;\r
+                       repoUrlTextBox.Enabled          = selected;\r
+                       if (selected) {\r
+                               repoUrlTextBox.Text = repos[repoListCheckedListBox.SelectedIndex].Url.Href;\r
+                               repoUrlTextBox.SelectAll();\r
+                       } else {\r
+                               repoUrlTextBox.Clear();\r
+                       }\r
+               }\r
+               \r
+               void AddRepoButtonClick(object sender, EventArgs e)\r
+               {\r
+                       RepositoryInfo repo = new RepositoryInfo();\r
+                       repo.Name = string.Format("新しいレポジトリ");\r
+                       repo.Url = new LocationEntry();\r
+                       repo.Enabled = true;\r
+                       \r
+                       repos.Add(repo);\r
+                       \r
+                       updateRepos();\r
+                       repoListCheckedListBox.SelectedIndex = repos.Count - 1;\r
+                       \r
+                       isRepositoriesChanged = true;\r
+               }\r
+               \r
+               void RepoListCheckedListBoxItemCheck(object sender, ItemCheckEventArgs e)\r
+               {\r
+                       repos[e.Index].Enabled = (e.NewValue == CheckState.Checked);\r
+                       \r
+                       isRepositoriesChanged = true;\r
+               }\r
+               \r
+               void RemoveRepoButtonClick(object sender, EventArgs e)\r
+               {\r
+                       int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
+                       if ((0 <= selectedIndex) && (selectedIndex < repos.Count)) {\r
+                               string text = string.Format("本当にレポジトリ「{0}」を消去しますか?", repos[selectedIndex].Name);\r
+                               DialogResult result = MessageBox.Show(text, "レポジトリの削除", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);\r
+                               if (result == DialogResult.OK) {\r
+                                       repos.RemoveAt(selectedIndex);\r
+                                       repoListCheckedListBox.Items.RemoveAt(selectedIndex);\r
+                                       \r
+                                       isRepositoriesChanged = true;\r
+                               }\r
+                       }\r
+               }\r
+               \r
+               void UpRepoButtonClick(object sender, EventArgs e)\r
+               {\r
+                       int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
+                       if ((1 <= selectedIndex) && (selectedIndex < repos.Count)) {\r
+                               NaGet.Utils.ListSwap(repos, selectedIndex-1, selectedIndex);\r
+                               AppliStation.Util.GUIUtils.CheckedListBox_SwapItems(repoListCheckedListBox, selectedIndex-1, selectedIndex);\r
+                               repoListCheckedListBox.SelectedIndex --;\r
+                               \r
+                               isRepositoriesChanged = true;\r
+                       }\r
+               }\r
+               \r
+               void DownRepoButtonClick(object sender, EventArgs e)\r
+               {\r
+                       int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
+                       if ((0 <= selectedIndex) && (selectedIndex < (repos.Count-1))) {\r
+                               NaGet.Utils.ListSwap(repos, selectedIndex, selectedIndex+1);\r
+                               AppliStation.Util.GUIUtils.CheckedListBox_SwapItems(repoListCheckedListBox, selectedIndex, selectedIndex+1);\r
+                               repoListCheckedListBox.SelectedIndex ++;\r
+                               \r
+                               isRepositoriesChanged = true;\r
+                       }\r
+               }\r
+               \r
+               void RepoUrlTextBoxLeave(object sender, EventArgs e)\r
+               {\r
+                       int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
+                       if ((0 <= selectedIndex) && (selectedIndex < repos.Count)) {\r
+                               repos[selectedIndex].Url = new LocationEntry(repoUrlTextBox.Text);\r
+                               repoListCheckedListBox.Items[selectedIndex] = repoListCheckedListBoxRenderer(repos[selectedIndex]);\r
+                               \r
+                               isRepositoriesChanged = true;\r
+                       }\r
+               }\r
+               \r
+               public bool IsRepositoryListSettingChanged {\r
+                       get { return isRepositoriesChanged; }\r
+               }\r
+               \r
+               private void commitRepositorySetting()\r
+               {\r
+                       if (isRepositoriesChanged) {\r
+                               NaGet.Utils.PutSerializeObject<RepositoriesList>(NaGet.Env.RepositoriesListFile, this.RepositoriesListSetting);\r
+                       }\r
+               }\r
+               \r
+               void OkButtonClick(object sender, EventArgs e)\r
+               {\r
+                       commitRepositorySetting();\r
+               }\r
+               \r
+               void CancelButtonClick(object sender, EventArgs e)\r
+               {\r
+               }\r
+       }\r
+}\r
diff --git a/AppliStation/UserPrefForm.resx b/AppliStation/UserPrefForm.resx
new file mode 100644 (file)
index 0000000..5ea0895
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+  <!-- \r
+    Microsoft ResX Schema \r
+    \r
+    Version 2.0\r
+    \r
+    The primary goals of this format is to allow a simple XML format \r
+    that is mostly human readable. The generation and parsing of the \r
+    various data types are done through the TypeConverter classes \r
+    associated with the data types.\r
+    \r
+    Example:\r
+    \r
+    ... ado.net/XML headers & schema ...\r
+    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+    <resheader name="version">2.0</resheader>\r
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+    </data>\r
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+        <comment>This is a comment</comment>\r
+    </data>\r
+                \r
+    There are any number of "resheader" rows that contain simple \r
+    name/value pairs.\r
+    \r
+    Each data row contains a name, and value. The row also contains a \r
+    type or mimetype. Type corresponds to a .NET class that support \r
+    text/value conversion through the TypeConverter architecture. \r
+    Classes that don't support this are serialized and stored with the \r
+    mimetype set.\r
+    \r
+    The mimetype is used for serialized objects, and tells the \r
+    ResXResourceReader how to depersist the object. This is currently not \r
+    extensible. For a given mimetype the value must be set accordingly:\r
+    \r
+    Note - application/x-microsoft.net.object.binary.base64 is the format \r
+    that the ResXResourceWriter will generate, however the reader can \r
+    read any of the formats listed below.\r
+    \r
+    mimetype: application/x-microsoft.net.object.binary.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+            : and then encoded with base64 encoding.\r
+    \r
+    mimetype: application/x-microsoft.net.object.soap.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+            : and then encoded with base64 encoding.\r
+\r
+    mimetype: application/x-microsoft.net.object.bytearray.base64\r
+    value   : The object must be serialized into a byte array \r
+            : using a System.ComponentModel.TypeConverter\r
+            : and then encoded with base64 encoding.\r
+    -->\r
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+    <xsd:element name="root" msdata:IsDataSet="true">\r
+      <xsd:complexType>\r
+        <xsd:choice maxOccurs="unbounded">\r
+          <xsd:element name="metadata">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" use="required" type="xsd:string" />\r
+              <xsd:attribute name="type" type="xsd:string" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="assembly">\r
+            <xsd:complexType>\r
+              <xsd:attribute name="alias" type="xsd:string" />\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="data">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="resheader">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+        </xsd:choice>\r
+      </xsd:complexType>\r
+    </xsd:element>\r
+  </xsd:schema>\r
+  <resheader name="resmimetype">\r
+    <value>text/microsoft-resx</value>\r
+  </resheader>\r
+  <resheader name="version">\r
+    <value>2.0</value>\r
+  </resheader>\r
+  <resheader name="reader">\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <resheader name="writer">\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+</root>
\ No newline at end of file
index 3cfd8e6..74a75be 100644 (file)
@@ -209,10 +209,8 @@ namespace NaGet.Packages
        /// <summary>\r
        /// リソースの位置を示すクラス\r
        /// </summary>\r
-       public class LocationEntry\r
+       public sealed class LocationEntry\r
        {\r
-               // TODO LocationEntryは果たして必要なのかの、考察\r
-               \r
                /// <summary>\r
                /// コンストラクタ\r
                /// </summary>\r
index 99eba63..a2cd1a4 100644 (file)
@@ -1,4 +1,5 @@
 using System;\r
+using System.ComponentModel;\r
 using System.Xml.Serialization;\r
 using System.Collections.Generic;\r
 \r
@@ -61,12 +62,13 @@ namespace NaGet.Packages
        /// <summary>\r
        /// パッケージリストを提供するレポジトリの参照情報を格納するクラス\r
        /// </summary>\r
-       public sealed class RepositoryInfo\r
+       public class RepositoryInfo\r
        {\r
                /// <summary>\r
                /// レポジトリの提供するソフトリストの名称\r
                /// </summary>\r
                [XmlAttribute]\r
+               [ReadOnly(true)]\r
                public string Name;\r
                \r
                /// <summary>\r
@@ -78,6 +80,7 @@ namespace NaGet.Packages
                /// ソフトリストを読み取るか否か(無視するか否か)のフラグ。\r
                /// </summary>\r
                [XmlAttribute]\r
+               [DefaultValue(true)]\r
                public bool Enabled = true;\r
        }\r
 }\r
index fc04e8b..b87dde5 100644 (file)
@@ -1,33 +1,29 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Xml.Serialization;
-using System.ComponentModel;
-
-namespace NaGet
-{
-       /// <summary>
-       /// na-get-libの全般設定クラス
-       /// </summary>
-       [XmlRoot("Pref")]
-       public class NaGetLibPref
-       {
-               /// <summary>
-               /// アプリケーションデータを置くフォルダ。
-               /// </summary>
-               /// <remarks>デフォルトではカレントディレクトリ</remarks>
-               [Category("Default")]
-               [DefaultValue(null)]
-               [XmlElement]
-               public string AppDataFolder = null;
-               
-               /// <summary>
-               /// ネットワークアクセスに使うプロキシをURL形式で指定する。
-               /// </summary>
-               /// <remarks>デフォルトではシステムの設定を使用する</remarks>
-               [Category("Network")]
-               [DefaultValue(null)]
-               [XmlElement]
-               public string ProxyAddress = null;
-       }
-}
+using System;\r
+using System.IO;\r
+using System.Collections.Generic;\r
+using System.Xml.Serialization;\r
+using System.ComponentModel;\r
+\r
+namespace NaGet\r
+{\r
+       /// <summary>\r
+       /// na-get-libの全般設定クラス\r
+       /// </summary>\r
+       [XmlRoot("Pref")]\r
+       public class NaGetLibPref\r
+       {\r
+               /// <summary>\r
+               /// アプリケーションデータを置くフォルダ。\r
+               /// </summary>\r
+               /// <remarks>デフォルトではカレントディレクトリ</remarks>\r
+               [XmlElement]\r
+               public string AppDataFolder = null;\r
+               \r
+               /// <summary>\r
+               /// ネットワークアクセスに使うプロキシをURL形式で指定する。\r
+               /// </summary>\r
+               /// <remarks>デフォルトではシステムの設定を使用する</remarks>\r
+               [XmlElement]\r
+               public string ProxyAddress = null;\r
+       }\r
+}\r
index 7f662d9..59a61d7 100644 (file)
@@ -40,6 +40,10 @@ namespace NaGet
                        }\r
                }\r
                \r
+               #endregion\r
+               \r
+               #region リスト関連関数\r
+               \r
                /// <summary>\r
                /// イテレータを結合して、返す\r
                /// </summary>\r
@@ -107,8 +111,25 @@ namespace NaGet
                        }\r
                }\r
                \r
-               #endregion\r
+               /// <summary>\r
+               /// リストに対して指定した2つの要素の位置を入れ替える\r
+               /// </summary>\r
+               /// <param name="list">操作対象のリスト</param>\r
+               /// <param name="indexA">位置</param>\r
+               /// <param name="indexB">位置</param>\r
+               public static void ListSwap(System.Collections.IList list, int indexA, int indexB)\r
+               {\r
+                       if ((indexA < 0) || (list.Count <= indexA) || (indexB < 0) || (list.Count <= indexB)) {\r
+                               throw new IndexOutOfRangeException();\r
+                       } else if (indexA != indexB) {\r
+                               object temp = list[indexA];\r
+                               list[indexA] = list[indexB];\r
+                               list[indexB] = temp;\r
+                       }\r
+               }\r
                \r
+               #endregion\r
+                               \r
                #region ファイル情報関連ユーテイリティ関数\r
                \r
                /// <summary>\r
@@ -481,6 +502,7 @@ namespace NaGet
                \r
                #endregion\r
 \r
+               #region イベント情報\r
                \r
                /// <summary>\r
                /// 任意データのイベント情報を表現するクラス\r
@@ -504,5 +526,7 @@ namespace NaGet
                                get { return data; }\r
                        }\r
                }\r
+\r
+               #endregion\r
        }\r
 }\r