aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee14 <alee14498@gmail.com>2018-09-02 16:34:58 -0400
committerAlee14 <alee14498@gmail.com>2018-09-02 16:34:58 -0400
commitecf32dc6159e24684220cee5bc1f239d905cf71d (patch)
tree3ad25ff1bcf54c74cec1c1d0d597ef269dc291e1
parent8de3e081c1532c857e633662f2bc11b67c38b385 (diff)
downloadProject-Silicon-ecf32dc6159e24684220cee5bc1f239d905cf71d.tar.gz
Project-Silicon-ecf32dc6159e24684220cee5bc1f239d905cf71d.tar.bz2
Project-Silicon-ecf32dc6159e24684220cee5bc1f239d905cf71d.zip
file manager is kind of working?
-rw-r--r--Project Ports/Desktop.cs11
-rw-r--r--Project Ports/Programs/FileManager.Designer.cs22
-rw-r--r--Project Ports/Programs/FileManager.cs16
3 files changed, 26 insertions, 23 deletions
diff --git a/Project Ports/Desktop.cs b/Project Ports/Desktop.cs
index 16e19ba..9f1266a 100644
--- a/Project Ports/Desktop.cs
+++ b/Project Ports/Desktop.cs
@@ -107,6 +107,12 @@ namespace Project_Ports
appMenu.Hide();
}
+ private void btnFileManager_Click(object sender, EventArgs e)
+ {
+ wm.createWindow(new Programs.FileManager(), "File Manager");
+ appMenu.Hide();
+ }
+
private async void btnhijack2_Click(object sender, EventArgs e)
{
appMenu.Hide();
@@ -134,10 +140,5 @@ namespace Project_Ports
{
}
-
- private void btnFileManager_Click(object sender, EventArgs e)
- {
-
- }
}
}
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]);
+ }
}
}