FreeTrainの進化系を目指す
プラグインダイアログのコンテキストメニューからplugin.xmlやフォルダの場所を開けるように
| @@ -11,6 +11,7 @@ | ||
| 11 | 11 | using nft.win32util; |
| 12 | 12 | using nft.controls; |
| 13 | 13 | using System.IO; |
| 14 | +using System.Diagnostics; | |
| 14 | 15 | |
| 15 | 16 | namespace nft.ui.system |
| 16 | 17 | { |
| @@ -36,6 +37,10 @@ | ||
| 36 | 37 | private System.Windows.Forms.ColumnHeader pathColumn; |
| 37 | 38 | private System.Windows.Forms.ImageList image; |
| 38 | 39 | private nft.controls.MsgAndIconLabel labelMsg; |
| 40 | + private ContextMenuStrip pluginCtxMenu; | |
| 41 | + private ToolStripMenuItem pluginCtxMenu_OpenFile; | |
| 42 | + private ToolStripMenuItem pluginCtxMenu_OpenByExplorer; | |
| 43 | + private ToolStripMenuItem pluginCtxMenu_CopyURI; | |
| 39 | 44 | private System.ComponentModel.IContainer components; |
| 40 | 45 | |
| 41 | 46 | public PluginListDialog() |
| @@ -69,222 +74,268 @@ | ||
| 69 | 74 | /// </summary> |
| 70 | 75 | private void InitializeComponent() |
| 71 | 76 | { |
| 72 | - this.components = new System.ComponentModel.Container(); | |
| 73 | - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PluginListDialog)); | |
| 74 | - this.panel1 = new System.Windows.Forms.Panel(); | |
| 75 | - this.labelMsg = new nft.controls.MsgAndIconLabel(); | |
| 76 | - this.button1 = new System.Windows.Forms.Button(); | |
| 77 | - this.plist = new System.Windows.Forms.ListView(); | |
| 78 | - this.titleColumn = new System.Windows.Forms.ColumnHeader(); | |
| 79 | - this.authorColumn = new System.Windows.Forms.ColumnHeader(); | |
| 80 | - this.pathColumn = new System.Windows.Forms.ColumnHeader(); | |
| 81 | - this.image = new System.Windows.Forms.ImageList(this.components); | |
| 82 | - this.tree = new System.Windows.Forms.TreeView(); | |
| 83 | - this.tabControl1 = new System.Windows.Forms.TabControl(); | |
| 84 | - this.tabPage1 = new System.Windows.Forms.TabPage(); | |
| 85 | - this.clist = new System.Windows.Forms.ListView(); | |
| 86 | - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); | |
| 87 | - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); | |
| 88 | - this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); | |
| 89 | - this.tabPage2 = new System.Windows.Forms.TabPage(); | |
| 90 | - this.info = new UrlLinkLabel(); | |
| 91 | - this.panel1.SuspendLayout(); | |
| 92 | - this.tabControl1.SuspendLayout(); | |
| 93 | - this.tabPage1.SuspendLayout(); | |
| 94 | - this.tabPage2.SuspendLayout(); | |
| 95 | - this.SuspendLayout(); | |
| 96 | - // | |
| 97 | - // panel1 | |
| 98 | - // | |
| 99 | - this.panel1.Controls.Add(this.labelMsg); | |
| 100 | - this.panel1.Controls.Add(this.button1); | |
| 101 | - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; | |
| 102 | - this.panel1.Location = new System.Drawing.Point(0, 277); | |
| 103 | - this.panel1.Name = "panel1"; | |
| 104 | - this.panel1.Size = new System.Drawing.Size(432, 32); | |
| 105 | - this.panel1.TabIndex = 0; | |
| 106 | - // | |
| 107 | - // labelMsg | |
| 108 | - // | |
| 109 | - this.labelMsg.BackColor = System.Drawing.SystemColors.Control; | |
| 110 | - this.labelMsg.BorderStyle = System.Windows.Forms.BorderStyle.None; | |
| 111 | - this.labelMsg.ImageIndex = -1; | |
| 112 | - this.labelMsg.ImageList = null; | |
| 113 | - this.labelMsg.Location = new System.Drawing.Point(8, 0); | |
| 114 | - this.labelMsg.Message = ""; | |
| 115 | - this.labelMsg.Name = "labelMsg"; | |
| 116 | - this.labelMsg.Size = new System.Drawing.Size(312, 32); | |
| 117 | - this.labelMsg.TabIndex = 1; | |
| 118 | - // | |
| 119 | - // button1 | |
| 120 | - // | |
| 121 | - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
| 122 | - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; | |
| 123 | - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System; | |
| 124 | - this.button1.Location = new System.Drawing.Point(336, 4); | |
| 125 | - this.button1.Name = "button1"; | |
| 126 | - this.button1.Size = new System.Drawing.Size(88, 24); | |
| 127 | - this.button1.TabIndex = 0; | |
| 128 | - this.button1.Text = "&OK"; | |
| 129 | - // | |
| 130 | - // plist | |
| 131 | - // | |
| 132 | - this.plist.AllowColumnReorder = true; | |
| 133 | - this.plist.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
| 134 | - | System.Windows.Forms.AnchorStyles.Left) | |
| 135 | - | System.Windows.Forms.AnchorStyles.Right))); | |
| 136 | - this.plist.CheckBoxes = true; | |
| 137 | - this.plist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |
| 138 | - this.titleColumn, | |
| 139 | - this.authorColumn, | |
| 140 | - this.pathColumn}); | |
| 141 | - this.plist.FullRowSelect = true; | |
| 142 | - this.plist.HideSelection = false; | |
| 143 | - this.plist.Location = new System.Drawing.Point(0, 0); | |
| 144 | - this.plist.Name = "plist"; | |
| 145 | - this.plist.Size = new System.Drawing.Size(424, 152); | |
| 146 | - this.plist.SmallImageList = this.image; | |
| 147 | - this.plist.TabIndex = 1; | |
| 148 | - this.plist.View = System.Windows.Forms.View.Details; | |
| 149 | - this.plist.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); | |
| 150 | - this.plist.SelectedIndexChanged += new System.EventHandler(this.plist_SelectedIndexChanged); | |
| 151 | - this.plist.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.list_ItemCheck); | |
| 152 | - // | |
| 153 | - // titleColumn | |
| 154 | - // | |
| 155 | - this.titleColumn.Text = "プラグイン"; | |
| 156 | - this.titleColumn.Width = 150; | |
| 157 | - // | |
| 158 | - // authorColumn | |
| 159 | - // | |
| 160 | - this.authorColumn.Text = "製作者"; | |
| 161 | - this.authorColumn.Width = 80; | |
| 162 | - // | |
| 163 | - // pathColumn | |
| 164 | - // | |
| 165 | - this.pathColumn.Text = "場所"; | |
| 166 | - this.pathColumn.Width = 500; | |
| 167 | - // | |
| 168 | - // image | |
| 169 | - // | |
| 170 | - this.image.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit; | |
| 171 | - this.image.ImageSize = new System.Drawing.Size(16, 16); | |
| 172 | - this.image.TransparentColor = System.Drawing.Color.Magenta; | |
| 173 | - // | |
| 174 | - // tree | |
| 175 | - // | |
| 176 | - this.tree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
| 177 | - | System.Windows.Forms.AnchorStyles.Left) | |
| 178 | - | System.Windows.Forms.AnchorStyles.Right))); | |
| 179 | - this.tree.CheckBoxes = true; | |
| 180 | - this.tree.HideSelection = false; | |
| 181 | - this.tree.ImageList = this.image; | |
| 182 | - this.tree.Location = new System.Drawing.Point(0, 0); | |
| 183 | - this.tree.Name = "tree"; | |
| 184 | - this.tree.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { | |
| 185 | - new System.Windows.Forms.TreeNode("ノード0")}); | |
| 186 | - this.tree.Size = new System.Drawing.Size(424, 200); | |
| 187 | - this.tree.TabIndex = 1; | |
| 188 | - this.tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tree_AfterSelect); | |
| 189 | - this.tree.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeCheck); | |
| 190 | - this.tree.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeExpand); | |
| 191 | - // | |
| 192 | - // tabControl1 | |
| 193 | - // | |
| 194 | - this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons; | |
| 195 | - this.tabControl1.Controls.Add(this.tabPage1); | |
| 196 | - this.tabControl1.Controls.Add(this.tabPage2); | |
| 197 | - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; | |
| 198 | - this.tabControl1.Location = new System.Drawing.Point(0, 0); | |
| 199 | - this.tabControl1.Name = "tabControl1"; | |
| 200 | - this.tabControl1.SelectedIndex = 0; | |
| 201 | - this.tabControl1.Size = new System.Drawing.Size(432, 277); | |
| 202 | - this.tabControl1.TabIndex = 2; | |
| 203 | - this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); | |
| 204 | - // | |
| 205 | - // tabPage1 | |
| 206 | - // | |
| 207 | - this.tabPage1.Controls.Add(this.clist); | |
| 208 | - this.tabPage1.Controls.Add(this.plist); | |
| 209 | - this.tabPage1.Location = new System.Drawing.Point(4, 24); | |
| 210 | - this.tabPage1.Name = "tabPage1"; | |
| 211 | - this.tabPage1.Size = new System.Drawing.Size(424, 249); | |
| 212 | - this.tabPage1.TabIndex = 0; | |
| 213 | - this.tabPage1.Text = "リスト表示"; | |
| 214 | - // | |
| 215 | - // clist | |
| 216 | - // | |
| 217 | - this.clist.AllowColumnReorder = true; | |
| 218 | - this.clist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | |
| 219 | - | System.Windows.Forms.AnchorStyles.Right))); | |
| 220 | - this.clist.CheckBoxes = true; | |
| 221 | - this.clist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |
| 222 | - this.columnHeader1, | |
| 223 | - this.columnHeader2, | |
| 224 | - this.columnHeader3}); | |
| 225 | - this.clist.FullRowSelect = true; | |
| 226 | - this.clist.Location = new System.Drawing.Point(0, 153); | |
| 227 | - this.clist.Name = "clist"; | |
| 228 | - this.clist.Size = new System.Drawing.Size(424, 96); | |
| 229 | - this.clist.SmallImageList = this.image; | |
| 230 | - this.clist.TabIndex = 2; | |
| 231 | - this.clist.View = System.Windows.Forms.View.Details; | |
| 232 | - this.clist.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); | |
| 233 | - this.clist.SelectedIndexChanged += new System.EventHandler(this.list_SelectedIndexChenged); | |
| 234 | - this.clist.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.list_ItemCheck); | |
| 235 | - // | |
| 236 | - // columnHeader1 | |
| 237 | - // | |
| 238 | - this.columnHeader1.Text = "コントリビューション"; | |
| 239 | - this.columnHeader1.Width = 150; | |
| 240 | - // | |
| 241 | - // columnHeader2 | |
| 242 | - // | |
| 243 | - this.columnHeader2.Text = "種類"; | |
| 244 | - this.columnHeader2.Width = 120; | |
| 245 | - // | |
| 246 | - // columnHeader3 | |
| 247 | - // | |
| 248 | - this.columnHeader3.Text = "ID"; | |
| 249 | - this.columnHeader3.Width = 400; | |
| 250 | - // | |
| 251 | - // tabPage2 | |
| 252 | - // | |
| 253 | - this.tabPage2.Controls.Add(this.info); | |
| 254 | - this.tabPage2.Controls.Add(this.tree); | |
| 255 | - this.tabPage2.Location = new System.Drawing.Point(4, 24); | |
| 256 | - this.tabPage2.Name = "tabPage2"; | |
| 257 | - this.tabPage2.Size = new System.Drawing.Size(424, 249); | |
| 258 | - this.tabPage2.TabIndex = 1; | |
| 259 | - this.tabPage2.Text = "ツリー表示"; | |
| 260 | - // | |
| 261 | - // info | |
| 262 | - // | |
| 263 | - this.info.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; | |
| 264 | - this.info.Dock = System.Windows.Forms.DockStyle.Bottom; | |
| 265 | - this.info.Location = new System.Drawing.Point(0, 209); | |
| 266 | - this.info.Name = "info"; | |
| 267 | - this.info.Size = new System.Drawing.Size(424, 40); | |
| 268 | - this.info.TabIndex = 2; | |
| 269 | - this.info.TargetUrl = null; | |
| 270 | - // | |
| 271 | - // PluginListDialog | |
| 272 | - // | |
| 273 | - this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); | |
| 274 | - this.ClientSize = new System.Drawing.Size(432, 309); | |
| 275 | - this.Controls.Add(this.tabControl1); | |
| 276 | - this.Controls.Add(this.panel1); | |
| 277 | - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); | |
| 278 | - this.MaximizeBox = false; | |
| 279 | - this.MinimizeBox = false; | |
| 280 | - this.Name = "PluginListDialog"; | |
| 281 | - this.Text = "インストールされているプラグイン"; | |
| 282 | - this.Load += new System.EventHandler(this.PluginListDialog_Load); | |
| 283 | - this.panel1.ResumeLayout(false); | |
| 284 | - this.tabControl1.ResumeLayout(false); | |
| 285 | - this.tabPage1.ResumeLayout(false); | |
| 286 | - this.tabPage2.ResumeLayout(false); | |
| 287 | - this.ResumeLayout(false); | |
| 77 | + this.components = new System.ComponentModel.Container(); | |
| 78 | + System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("ノード0"); | |
| 79 | + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PluginListDialog)); | |
| 80 | + this.panel1 = new System.Windows.Forms.Panel(); | |
| 81 | + this.labelMsg = new nft.controls.MsgAndIconLabel(); | |
| 82 | + this.button1 = new System.Windows.Forms.Button(); | |
| 83 | + this.plist = new System.Windows.Forms.ListView(); | |
| 84 | + this.titleColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 85 | + this.authorColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 86 | + this.pathColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 87 | + this.image = new System.Windows.Forms.ImageList(this.components); | |
| 88 | + this.tree = new System.Windows.Forms.TreeView(); | |
| 89 | + this.tabControl1 = new System.Windows.Forms.TabControl(); | |
| 90 | + this.tabPage1 = new System.Windows.Forms.TabPage(); | |
| 91 | + this.clist = new System.Windows.Forms.ListView(); | |
| 92 | + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 93 | + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 94 | + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); | |
| 95 | + this.tabPage2 = new System.Windows.Forms.TabPage(); | |
| 96 | + this.info = new nft.controls.UrlLinkLabel(); | |
| 97 | + this.pluginCtxMenu = new System.Windows.Forms.ContextMenuStrip(this.components); | |
| 98 | + this.pluginCtxMenu_OpenFile = new System.Windows.Forms.ToolStripMenuItem(); | |
| 99 | + this.pluginCtxMenu_OpenByExplorer = new System.Windows.Forms.ToolStripMenuItem(); | |
| 100 | + this.pluginCtxMenu_CopyURI = new System.Windows.Forms.ToolStripMenuItem(); | |
| 101 | + this.panel1.SuspendLayout(); | |
| 102 | + this.tabControl1.SuspendLayout(); | |
| 103 | + this.tabPage1.SuspendLayout(); | |
| 104 | + this.tabPage2.SuspendLayout(); | |
| 105 | + this.pluginCtxMenu.SuspendLayout(); | |
| 106 | + this.SuspendLayout(); | |
| 107 | + // | |
| 108 | + // panel1 | |
| 109 | + // | |
| 110 | + this.panel1.Controls.Add(this.labelMsg); | |
| 111 | + this.panel1.Controls.Add(this.button1); | |
| 112 | + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; | |
| 113 | + this.panel1.Location = new System.Drawing.Point(0, 277); | |
| 114 | + this.panel1.Name = "panel1"; | |
| 115 | + this.panel1.Size = new System.Drawing.Size(432, 32); | |
| 116 | + this.panel1.TabIndex = 0; | |
| 117 | + // | |
| 118 | + // labelMsg | |
| 119 | + // | |
| 120 | + this.labelMsg.BackColor = System.Drawing.SystemColors.Control; | |
| 121 | + this.labelMsg.ImageIndex = -1; | |
| 122 | + this.labelMsg.ImageList = null; | |
| 123 | + this.labelMsg.Location = new System.Drawing.Point(8, 0); | |
| 124 | + this.labelMsg.Message = ""; | |
| 125 | + this.labelMsg.Name = "labelMsg"; | |
| 126 | + this.labelMsg.Size = new System.Drawing.Size(312, 32); | |
| 127 | + this.labelMsg.TabIndex = 1; | |
| 128 | + // | |
| 129 | + // button1 | |
| 130 | + // | |
| 131 | + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
| 132 | + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; | |
| 133 | + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System; | |
| 134 | + this.button1.Location = new System.Drawing.Point(336, 4); | |
| 135 | + this.button1.Name = "button1"; | |
| 136 | + this.button1.Size = new System.Drawing.Size(88, 24); | |
| 137 | + this.button1.TabIndex = 0; | |
| 138 | + this.button1.Text = "&OK"; | |
| 139 | + // | |
| 140 | + // plist | |
| 141 | + // | |
| 142 | + this.plist.AllowColumnReorder = true; | |
| 143 | + this.plist.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
| 144 | + | System.Windows.Forms.AnchorStyles.Left) | |
| 145 | + | System.Windows.Forms.AnchorStyles.Right))); | |
| 146 | + this.plist.CheckBoxes = true; | |
| 147 | + this.plist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |
| 148 | + this.titleColumn, | |
| 149 | + this.authorColumn, | |
| 150 | + this.pathColumn}); | |
| 151 | + this.plist.FullRowSelect = true; | |
| 152 | + this.plist.HideSelection = false; | |
| 153 | + this.plist.Location = new System.Drawing.Point(0, 0); | |
| 154 | + this.plist.Name = "plist"; | |
| 155 | + this.plist.Size = new System.Drawing.Size(424, 151); | |
| 156 | + this.plist.SmallImageList = this.image; | |
| 157 | + this.plist.TabIndex = 1; | |
| 158 | + this.plist.UseCompatibleStateImageBehavior = false; | |
| 159 | + this.plist.View = System.Windows.Forms.View.Details; | |
| 160 | + this.plist.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); | |
| 161 | + this.plist.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.list_ItemCheck); | |
| 162 | + this.plist.SelectedIndexChanged += new System.EventHandler(this.plist_SelectedIndexChanged); | |
| 163 | + this.plist.MouseClick += new System.Windows.Forms.MouseEventHandler(this.plist_MouseClick); | |
| 164 | + // | |
| 165 | + // titleColumn | |
| 166 | + // | |
| 167 | + this.titleColumn.Text = "プラグイン"; | |
| 168 | + this.titleColumn.Width = 150; | |
| 169 | + // | |
| 170 | + // authorColumn | |
| 171 | + // | |
| 172 | + this.authorColumn.Text = "製作者"; | |
| 173 | + this.authorColumn.Width = 80; | |
| 174 | + // | |
| 175 | + // pathColumn | |
| 176 | + // | |
| 177 | + this.pathColumn.Text = "場所"; | |
| 178 | + this.pathColumn.Width = 500; | |
| 179 | + // | |
| 180 | + // image | |
| 181 | + // | |
| 182 | + this.image.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit; | |
| 183 | + this.image.ImageSize = new System.Drawing.Size(16, 16); | |
| 184 | + this.image.TransparentColor = System.Drawing.Color.Magenta; | |
| 185 | + // | |
| 186 | + // tree | |
| 187 | + // | |
| 188 | + this.tree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
| 189 | + | System.Windows.Forms.AnchorStyles.Left) | |
| 190 | + | System.Windows.Forms.AnchorStyles.Right))); | |
| 191 | + this.tree.CheckBoxes = true; | |
| 192 | + this.tree.HideSelection = false; | |
| 193 | + this.tree.ImageIndex = 0; | |
| 194 | + this.tree.ImageList = this.image; | |
| 195 | + this.tree.Location = new System.Drawing.Point(0, 0); | |
| 196 | + this.tree.Name = "tree"; | |
| 197 | + treeNode2.Name = ""; | |
| 198 | + treeNode2.Text = "ノード0"; | |
| 199 | + this.tree.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { | |
| 200 | + treeNode2}); | |
| 201 | + this.tree.SelectedImageIndex = 0; | |
| 202 | + this.tree.Size = new System.Drawing.Size(424, 199); | |
| 203 | + this.tree.TabIndex = 1; | |
| 204 | + this.tree.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeCheck); | |
| 205 | + this.tree.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeExpand); | |
| 206 | + this.tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tree_AfterSelect); | |
| 207 | + this.tree.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tree_Click); | |
| 208 | + // | |
| 209 | + // tabControl1 | |
| 210 | + // | |
| 211 | + this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons; | |
| 212 | + this.tabControl1.Controls.Add(this.tabPage1); | |
| 213 | + this.tabControl1.Controls.Add(this.tabPage2); | |
| 214 | + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; | |
| 215 | + this.tabControl1.Location = new System.Drawing.Point(0, 0); | |
| 216 | + this.tabControl1.Name = "tabControl1"; | |
| 217 | + this.tabControl1.SelectedIndex = 0; | |
| 218 | + this.tabControl1.Size = new System.Drawing.Size(432, 277); | |
| 219 | + this.tabControl1.TabIndex = 2; | |
| 220 | + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); | |
| 221 | + // | |
| 222 | + // tabPage1 | |
| 223 | + // | |
| 224 | + this.tabPage1.Controls.Add(this.clist); | |
| 225 | + this.tabPage1.Controls.Add(this.plist); | |
| 226 | + this.tabPage1.Location = new System.Drawing.Point(4, 25); | |
| 227 | + this.tabPage1.Name = "tabPage1"; | |
| 228 | + this.tabPage1.Size = new System.Drawing.Size(424, 248); | |
| 229 | + this.tabPage1.TabIndex = 0; | |
| 230 | + this.tabPage1.Text = "リスト表示"; | |
| 231 | + // | |
| 232 | + // clist | |
| 233 | + // | |
| 234 | + this.clist.AllowColumnReorder = true; | |
| 235 | + this.clist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | |
| 236 | + | System.Windows.Forms.AnchorStyles.Right))); | |
| 237 | + this.clist.CheckBoxes = true; | |
| 238 | + this.clist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { | |
| 239 | + this.columnHeader1, | |
| 240 | + this.columnHeader2, | |
| 241 | + this.columnHeader3}); | |
| 242 | + this.clist.FullRowSelect = true; | |
| 243 | + this.clist.Location = new System.Drawing.Point(0, 152); | |
| 244 | + this.clist.Name = "clist"; | |
| 245 | + this.clist.Size = new System.Drawing.Size(424, 96); | |
| 246 | + this.clist.SmallImageList = this.image; | |
| 247 | + this.clist.TabIndex = 2; | |
| 248 | + this.clist.UseCompatibleStateImageBehavior = false; | |
| 249 | + this.clist.View = System.Windows.Forms.View.Details; | |
| 250 | + this.clist.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.list_ColumnClick); | |
| 251 | + this.clist.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.list_ItemCheck); | |
| 252 | + this.clist.SelectedIndexChanged += new System.EventHandler(this.list_SelectedIndexChenged); | |
| 253 | + // | |
| 254 | + // columnHeader1 | |
| 255 | + // | |
| 256 | + this.columnHeader1.Text = "コントリビューション"; | |
| 257 | + this.columnHeader1.Width = 150; | |
| 258 | + // | |
| 259 | + // columnHeader2 | |
| 260 | + // | |
| 261 | + this.columnHeader2.Text = "種類"; | |
| 262 | + this.columnHeader2.Width = 120; | |
| 263 | + // | |
| 264 | + // columnHeader3 | |
| 265 | + // | |
| 266 | + this.columnHeader3.Text = "ID"; | |
| 267 | + this.columnHeader3.Width = 400; | |
| 268 | + // | |
| 269 | + // tabPage2 | |
| 270 | + // | |
| 271 | + this.tabPage2.Controls.Add(this.info); | |
| 272 | + this.tabPage2.Controls.Add(this.tree); | |
| 273 | + this.tabPage2.Location = new System.Drawing.Point(4, 25); | |
| 274 | + this.tabPage2.Name = "tabPage2"; | |
| 275 | + this.tabPage2.Size = new System.Drawing.Size(424, 248); | |
| 276 | + this.tabPage2.TabIndex = 1; | |
| 277 | + this.tabPage2.Text = "ツリー表示"; | |
| 278 | + // | |
| 279 | + // info | |
| 280 | + // | |
| 281 | + this.info.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; | |
| 282 | + this.info.Dock = System.Windows.Forms.DockStyle.Bottom; | |
| 283 | + this.info.Location = new System.Drawing.Point(0, 208); | |
| 284 | + this.info.Name = "info"; | |
| 285 | + this.info.Size = new System.Drawing.Size(424, 40); | |
| 286 | + this.info.TabIndex = 2; | |
| 287 | + this.info.TargetUrl = null; | |
| 288 | + // | |
| 289 | + // pluginCtxMenu | |
| 290 | + // | |
| 291 | + this.pluginCtxMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { | |
| 292 | + this.pluginCtxMenu_OpenFile, | |
| 293 | + this.pluginCtxMenu_OpenByExplorer, | |
| 294 | + this.pluginCtxMenu_CopyURI}); | |
| 295 | + this.pluginCtxMenu.Name = "pluginCtxMenu"; | |
| 296 | + this.pluginCtxMenu.ShowImageMargin = false; | |
| 297 | + this.pluginCtxMenu.Size = new System.Drawing.Size(184, 92); | |
| 298 | + this.pluginCtxMenu.Opening += new System.ComponentModel.CancelEventHandler(this.pluginCtxMenu_Opening); | |
| 299 | + // | |
| 300 | + // pluginCtxMenu_OpenFile | |
| 301 | + // | |
| 302 | + this.pluginCtxMenu_OpenFile.Name = "pluginCtxMenu_OpenFile"; | |
| 303 | + this.pluginCtxMenu_OpenFile.Size = new System.Drawing.Size(183, 22); | |
| 304 | + this.pluginCtxMenu_OpenFile.Text = "plugin.xmlを開く"; | |
| 305 | + this.pluginCtxMenu_OpenFile.Click += new System.EventHandler(this.pluginCtxMenu_OpenFile_Click); | |
| 306 | + // | |
| 307 | + // pluginCtxMenu_OpenByExplorer | |
| 308 | + // | |
| 309 | + this.pluginCtxMenu_OpenByExplorer.Name = "pluginCtxMenu_OpenByExplorer"; | |
| 310 | + this.pluginCtxMenu_OpenByExplorer.Size = new System.Drawing.Size(183, 22); | |
| 311 | + this.pluginCtxMenu_OpenByExplorer.Text = "エクスプローラーで開く"; | |
| 312 | + this.pluginCtxMenu_OpenByExplorer.Click += new System.EventHandler(this.pluginCtxMenu_OpenByExplorer_Click); | |
| 313 | + // | |
| 314 | + // pluginCtxMenu_CopyURI | |
| 315 | + // | |
| 316 | + this.pluginCtxMenu_CopyURI.Name = "pluginCtxMenu_CopyURI"; | |
| 317 | + this.pluginCtxMenu_CopyURI.Size = new System.Drawing.Size(183, 22); | |
| 318 | + this.pluginCtxMenu_CopyURI.Text = "URIをコピー"; | |
| 319 | + this.pluginCtxMenu_CopyURI.Click += new System.EventHandler(this.puginCtxMenu_CopyURI_Click); | |
| 320 | + // | |
| 321 | + // PluginListDialog | |
| 322 | + // | |
| 323 | + this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); | |
| 324 | + this.ClientSize = new System.Drawing.Size(432, 309); | |
| 325 | + this.Controls.Add(this.tabControl1); | |
| 326 | + this.Controls.Add(this.panel1); | |
| 327 | + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); | |
| 328 | + this.MaximizeBox = false; | |
| 329 | + this.MinimizeBox = false; | |
| 330 | + this.Name = "PluginListDialog"; | |
| 331 | + this.Text = "インストールされているプラグイン"; | |
| 332 | + this.Load += new System.EventHandler(this.PluginListDialog_Load); | |
| 333 | + this.panel1.ResumeLayout(false); | |
| 334 | + this.tabControl1.ResumeLayout(false); | |
| 335 | + this.tabPage1.ResumeLayout(false); | |
| 336 | + this.tabPage2.ResumeLayout(false); | |
| 337 | + this.pluginCtxMenu.ResumeLayout(false); | |
| 338 | + this.ResumeLayout(false); | |
| 288 | 339 | |
| 289 | 340 | } |
| 290 | 341 | #endregion |
| @@ -307,6 +358,28 @@ | ||
| 307 | 358 | //tree.Nodes.Add( CreateTreeItem(p) ); |
| 308 | 359 | } |
| 309 | 360 | |
| 361 | + | |
| 362 | + private void plist_MouseClick(object sender, MouseEventArgs e) { | |
| 363 | + if (e.Button == MouseButtons.Right) { | |
| 364 | + if (plist.FocusedItem.Bounds.Contains(e.Location) == true) { | |
| 365 | + pluginCtxMenu.Tag = plist.FocusedItem.Tag; | |
| 366 | + pluginCtxMenu.Show(Cursor.Position); | |
| 367 | + } | |
| 368 | + } | |
| 369 | + } | |
| 370 | + | |
| 371 | + | |
| 372 | + private void tree_Click(object sender, MouseEventArgs e) { | |
| 373 | + if (e.Button == MouseButtons.Right) { | |
| 374 | + TreeNode node = tree.GetNodeAt(e.Location); | |
| 375 | + if (node!=null && node.Tag is Plugin) { | |
| 376 | + tree.SelectedNode = node; | |
| 377 | + pluginCtxMenu.Tag = node.Tag; | |
| 378 | + pluginCtxMenu.Show(Cursor.Position); | |
| 379 | + } | |
| 380 | + } | |
| 381 | + } | |
| 382 | + | |
| 310 | 383 | private void list_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e) |
| 311 | 384 | { |
| 312 | 385 |
| @@ -476,6 +549,7 @@ | ||
| 476 | 549 | ListViewItem item = new ListViewItem(new string[]{ p.Title, p.author, p.ID }, icon ); |
| 477 | 550 | item.Tag = p; |
| 478 | 551 | item.Checked = p.IsAttached; |
| 552 | + | |
| 479 | 553 | return item; |
| 480 | 554 | } |
| 481 | 555 | private TreeNode CreateTreeItem(Contribution c) |
| @@ -630,5 +704,44 @@ | ||
| 630 | 704 | return string.Compare(sx,sy); |
| 631 | 705 | } |
| 632 | 706 | } |
| 707 | + | |
| 708 | + private void pluginCtxMenu_OpenFile_Click(object sender, EventArgs e) { | |
| 709 | + Debug.WriteLine(pluginCtxMenu_OpenFile.Tag); | |
| 710 | + Process.Start(pluginCtxMenu_OpenFile.Tag as string); | |
| 711 | + } | |
| 712 | + | |
| 713 | + private void pluginCtxMenu_OpenByExplorer_Click(object sender, EventArgs e) { | |
| 714 | + if (pluginCtxMenu_OpenByExplorer.Tag != null) { | |
| 715 | + Debug.WriteLine(pluginCtxMenu_OpenByExplorer.Tag); | |
| 716 | + Process.Start("explorer.exe", "/e," + pluginCtxMenu_OpenByExplorer.Tag); | |
| 717 | + } | |
| 718 | + } | |
| 719 | + | |
| 720 | + private void puginCtxMenu_CopyURI_Click(object sender, EventArgs e) { | |
| 721 | + Clipboard.SetText(pluginCtxMenu_CopyURI.Tag as string); | |
| 722 | + } | |
| 723 | + | |
| 724 | + private void pluginCtxMenu_Opening(object sender, CancelEventArgs e) { | |
| 725 | + try { | |
| 726 | + Plugin p = pluginCtxMenu.Tag as Plugin; | |
| 727 | + pluginCtxMenu_CopyURI.Tag = p.Uri.AbsoluteUri; | |
| 728 | + Debug.WriteLine(p.Uri.AbsoluteUri); | |
| 729 | + string localpath = p.Uri.LocalPath + Uri.UnescapeDataString(p.Uri.Fragment); | |
| 730 | + pluginCtxMenu_OpenByExplorer.Enabled = Directory.Exists(localpath); | |
| 731 | + if (pluginCtxMenu_OpenByExplorer.Enabled) { | |
| 732 | + pluginCtxMenu_OpenByExplorer.Tag = localpath; | |
| 733 | + pluginCtxMenu_OpenFile.Tag = Path.Combine(localpath, Plugin.PluginFileName); | |
| 734 | + } else { | |
| 735 | + pluginCtxMenu_OpenByExplorer.Tag = null; | |
| 736 | + pluginCtxMenu_OpenFile.Tag = new Uri(p.Uri, Plugin.PluginFileName).AbsoluteUri; | |
| 737 | + } | |
| 738 | + pluginCtxMenu_OpenByExplorer.Tag = localpath; | |
| 739 | + } catch (Exception ex) { | |
| 740 | + Debug.WriteLine(ex.Message); | |
| 741 | + Debug.WriteLine(ex.StackTrace); | |
| 742 | + } | |
| 743 | + } | |
| 744 | + | |
| 745 | + | |
| 633 | 746 | } |
| 634 | 747 | } |