diff options
Diffstat (limited to 'Project Ports/Programs')
| -rw-r--r-- | Project Ports/Programs/FileManager.Designer.cs | 22 | ||||
| -rw-r--r-- | Project Ports/Programs/FileManager.cs | 16 |
2 files changed, 20 insertions, 18 deletions
diff --git a/Project Ports/Programs/FileManager.Designer.cs b/Project Ports/Programs/FileManager.Designer.cs index 8b88d47..61ae36b 100644 --- a/Project Ports/Programs/FileManager.Designer.cs +++ b/Project Ports/Programs/FileManager.Designer.cs @@ -31,7 +31,6 @@ this.components = new System.ComponentModel.Container(); this.imageList = new System.Windows.Forms.ImageList(this.components); this.listView = new System.Windows.Forms.ListView(); - this.label1 = new System.Windows.Forms.Label(); this.txtPath = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // @@ -49,17 +48,7 @@ this.listView.Size = new System.Drawing.Size(790, 501); this.listView.TabIndex = 0; this.listView.UseCompatibleStateImageBehavior = false; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(20, 19); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(42, 15); - this.label1.TabIndex = 1; - this.label1.Text = "Path:"; + this.listView.SelectedIndexChanged += new System.EventHandler(this.listView_SelectedIndexChanged); // // txtPath // @@ -68,21 +57,19 @@ this.txtPath.Cursor = System.Windows.Forms.Cursors.Arrow; this.txtPath.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtPath.ForeColor = System.Drawing.Color.Black; - this.txtPath.Location = new System.Drawing.Point(68, 14); + this.txtPath.Location = new System.Drawing.Point(23, 14); this.txtPath.Multiline = true; this.txtPath.Name = "txtPath"; this.txtPath.ReadOnly = true; - this.txtPath.Size = new System.Drawing.Size(744, 25); + this.txtPath.Size = new System.Drawing.Size(789, 25); this.txtPath.TabIndex = 2; - this.txtPath.Text = "/"; // // FileManager // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Gray; + this.BackColor = System.Drawing.Color.Black; this.Controls.Add(this.txtPath); - this.Controls.Add(this.label1); this.Controls.Add(this.listView); this.Name = "FileManager"; this.Size = new System.Drawing.Size(835, 575); @@ -96,7 +83,6 @@ private System.Windows.Forms.ImageList imageList; private System.Windows.Forms.ListView listView; - private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txtPath; } } diff --git a/Project Ports/Programs/FileManager.cs b/Project Ports/Programs/FileManager.cs index c72378d..12060b0 100644 --- a/Project Ports/Programs/FileManager.cs +++ b/Project Ports/Programs/FileManager.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PortEngine; +using System.Diagnostics; namespace Project_Ports.Programs { @@ -24,7 +25,22 @@ namespace Project_Ports.Programs { listFiles.Clear(); listView.Items.Clear(); + DirectoryInfo fmdataFolder = new DirectoryInfo(FileSystem.dataFolder); + txtPath.Text = fmdataFolder.FullName; + foreach (string item in Directory.GetFiles(fmdataFolder.FullName)) + { + imageList.Images.Add(System.Drawing.Icon.ExtractAssociatedIcon(item)); + FileInfo fi = new FileInfo(item); + listFiles.Add(fi.FullName); + listView.Items.Add(fi.Name, imageList.Images.Count - 1); + } } + + private void listView_SelectedIndexChanged(object sender, EventArgs e) + { + if (listView.FocusedItem != null) + Process.Start(listFiles[listView.FocusedItem.Index]); + } } } |
