diff options
| author | lempamo <[email protected]> | 2017-07-04 09:55:19 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-04 09:55:19 -0400 |
| commit | d6ea0813da443a0e6a56b24ed2019fb9fc384735 (patch) | |
| tree | 92aa22c09204390dbf50b3e9494dacea28dcac48 /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs | |
| parent | 59c9e070258db893745f70862c4128b97a87c9fd (diff) | |
| download | histacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.tar.gz histacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.tar.bz2 histacom2-d6ea0813da443a0e6a56b24ed2019fb9fc384735.zip | |
Fixed TreeView in the not ALEXplorer
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs | 84 |
1 files changed, 64 insertions, 20 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs index c4673ed..91b88f5 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs @@ -16,15 +16,15 @@ namespace TimeHACK.OS.Win95.Win95Apps { public partial class WinClassicWindowsExplorer : UserControl { - public Boolean IsFileOpenDialog = false; - public Boolean IsFileSaveDialog = false; - public String onlyViewExtension = ""; - - String ToReplaceWith = ProfileDirectory; - String currentDirectory = Path.Combine(ProfileDirectory, "folders"); - String oldLabelText; - Int32 fileType = 6; - String attemptedDirectory = ""; + public bool IsFileOpenDialog = false; + public bool IsFileSaveDialog = false; + public string onlyViewExtension = ""; + + string ToReplaceWith = ProfileDirectory; + string currentDirectory = Path.Combine(ProfileDirectory, "folders/computer"); + string oldLabelText; + int fileType = 6; + string attemptedDirectory = ""; WindowManager wm = new WindowManager(); public WinClassicWindowsExplorer() @@ -72,10 +72,7 @@ namespace TimeHACK.OS.Win95.Win95Apps void RefreshAll() { try { // Refresh the right listview - icons.Images.Clear(); this.mainView.Items.Clear(); - diskView.ImageList = icons; - this.mainView.LargeImageList = icons; // For Each drive As String In My.Computer.FileSystem.GetDirectories(GameMain.MyDocuments & "\HistacomVB\" & GameMain.SaveProfile & "\HistacomVB\Folders") // If GetPropetiesForDir(drive)(4) = "isMyDocuments" Then // diskView.Items.Add("", 0) @@ -139,8 +136,8 @@ namespace TimeHACK.OS.Win95.Win95Apps } } - String ReturnType(String extension) { - String returnVal = ""; + string ReturnType(string extension) { + string returnVal = ""; fileType = 1; switch (extension) { case ".txt": @@ -435,13 +432,40 @@ namespace TimeHACK.OS.Win95.Win95Apps // IsFileDialog = False //End Sub void WinClassicWindowsExplorer_Load(object sender, EventArgs e) { - - diskView.ImageList.Images[0] = Properties.Resources.Win95DesktopIcon; - diskView.ImageList.Images[1] = Properties.Resources.Win95HardDiskIcon; + diskView.ImageList.Images.Add(Properties.Resources.Win95DesktopIcon); + diskView.ImageList.Images.Add(Properties.Resources.Win95HardDiskIcon); + diskView.ImageList.Images.Add(Properties.Resources.WinClassicFolderSmall); + diskView.ImageList.Images.Add(Properties.Resources.WinClassicOpenFolderSmall); + diskView.ImageList.Images.Add(Properties.Resources.Win95ControlPanelIcon); + diskView.ImageList.Images.Add(Properties.Resources.Win95PrintersFolder); + diskView.ImageList.Images.Add(Properties.Resources.Win95ComputerIcon); + diskView.ImageList.Images.Add(Properties.Resources.Win95NetworkIcon); + diskView.ImageList.Images.Add(Properties.Resources.Win95RecycleIcon); program.BringToFront(); - TreeNode rootnode = new TreeNode("Desktop", 0, 0); - diskView.Nodes.Add(rootnode); - diskView.Nodes["Desktop"].Nodes.Add(new TreeNode("(C:)", 1, 1)); + int loc = 0; + TreeNode[] folders = new TreeNode[new DirectoryInfo(currentDirectory).GetDirectories().Length]; + foreach (DirectoryInfo folder in new DirectoryInfo(currentDirectory).GetDirectories()) + { + if (folder.GetDirectories().Length > 0) + { + TreeNode[] tn = createSubDirNodes(folder); + folders[loc] = new TreeNode(folder.Name, 2, 3, tn); + } + else + { + folders[loc] = new TreeNode(folder.Name, 2, 3); + } + loc++; + } + TreeNode[] mypcarray = new TreeNode[3]; + mypcarray[0] = new TreeNode("(C:)", 1, 1, folders); + mypcarray[1] = new TreeNode("Control Panel", 4, 4); + mypcarray[2] = new TreeNode("Printers", 5, 5); + TreeNode[] desktoparray = new TreeNode[3]; + desktoparray[0] = new TreeNode("My Computer", 6, 6, mypcarray); + desktoparray[1] = new TreeNode("Network Neighborhood", 7, 7); + desktoparray[2] = new TreeNode("Recycle Bin", 8, 8); + diskView.Nodes.Add(new TreeNode("Desktop", 0, 0, desktoparray)); //diskView.Items.Add("My Computer", 0); Application.DoEvents(); RefreshAll(); @@ -631,5 +655,25 @@ namespace TimeHACK.OS.Win95.Win95Apps } RefreshAll(); } + + private TreeNode[] createSubDirNodes(DirectoryInfo folder) + { + TreeNode[] toReturn = new TreeNode[folder.GetDirectories().Length]; + int loc = 0; + foreach (DirectoryInfo fold in folder.GetDirectories()) + { + if (fold.GetDirectories().Length > 0) + { + TreeNode[] tn = createSubDirNodes(fold); + toReturn[loc] = new TreeNode(fold.Name, 2, 3, tn); + } + else + { + toReturn[loc] = new TreeNode(fold.Name, 2, 3); + } + loc++; + } + return toReturn; + } } } |
