diff options
| author | AShifter <[email protected]> | 2017-06-10 09:58:07 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-06-10 09:58:07 -0700 |
| commit | 1d1d8286e76751f29b354ef9d5f0ddfa455b3bd7 (patch) | |
| tree | 5a945ec6d1e2e565ffb0f5c67bb963846f04f26e /TimeHACK.Main | |
| parent | d9b6009e4909508bfb880b9f61e9e0f81d5ffa8b (diff) | |
| parent | ec8361de2a221cdb405df7c9400461e41785e12b (diff) | |
| download | histacom2-1d1d8286e76751f29b354ef9d5f0ddfa455b3bd7.tar.gz histacom2-1d1d8286e76751f29b354ef9d5f0ddfa455b3bd7.tar.bz2 histacom2-1d1d8286e76751f29b354ef9d5f0ddfa455b3bd7.zip | |
Merge pull request #85 from Alex-TIMEHACK/master
Added my changes back!
Diffstat (limited to 'TimeHACK.Main')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs | 32 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs | 115 | ||||
| -rw-r--r-- | TimeHACK.Main/obj/Release/CoreCompileInputs.cache | 2 | ||||
| -rw-r--r-- | TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferences.cache | bin | 35191 -> 35191 bytes | |||
| -rw-r--r-- | TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache | bin | 14502 -> 14898 bytes |
5 files changed, 112 insertions, 37 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs index e08e6ec..6dd6ee8 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs @@ -88,14 +88,38 @@ namespace TimeHACK.OS.Win95.Win95Apps private void openToolStripMenuItem_Click(object sender, EventArgs e) { - ActivateOpenFileDialog(".txt"); - mainText.Text = ReadTextFile(Program.OpenFileExplorerAsDialogAndReturnGivenPath()); + try + { + ActivateSaveFileDialog(".txt"); + String selectedPath; + selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + MessageBox.Show(selectedPath); + if (selectedPath != "") + { + mainText.Text = ReadTextFile(selectedPath); + } + } + catch + { + } } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - ActivateSaveFileDialog(".txt"); - File.WriteAllText(Program.OpenFileExplorerAsDialogAndReturnGivenPath(), mainText.Text); + try + { + ActivateSaveFileDialog(".txt"); + String selectedPath; + selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + MessageBox.Show(selectedPath); + if (selectedPath != "") + { + File.WriteAllText(selectedPath, mainText.Text); + } + } catch { + } } } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs index e8f97a0..2c84133 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs @@ -19,8 +19,10 @@ namespace TimeHACK.OS.Win95.Win95Apps 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 = ""; WindowManager wm = new WindowManager(); @@ -114,12 +116,12 @@ namespace TimeHACK.OS.Win95.Win95Apps { if (new FileInfo(str).Extension == onlyViewExtension) { - this.mainView.Items.Add(Path.GetFileName(str), 0); + this.mainView.Items.Add(Path.GetFileName(str), 2); } } } else { if (!(Path.GetFileName(str) == "_data.info")) { - this.mainView.Items.Add(Path.GetFileName(str)); + this.mainView.Items.Add(Path.GetFileName(str), 2); } } } @@ -427,6 +429,7 @@ namespace TimeHACK.OS.Win95.Win95Apps // IsFileDialog = False //End Sub void WinClassicWindowsExplorer_Load(object sender, EventArgs e) { + //icons.Images.Add(Properties.Resources.WinClassicFolder); //icons.Images.Add(Properties.Resources.WinClassicComputer); program.BringToFront(); @@ -464,23 +467,18 @@ namespace TimeHACK.OS.Win95.Win95Apps if ((String)mainView.FocusedItem.Tag != "") { // If it isn't a file GoToDir(currentDirectory + "\\" + mainView.FocusedItem.Tag); } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) { // If it is a open/save file dialog box - Program.WindowsExplorerReturnPath = currentDirectory + "\\" + mainView.FocusedItem.Text; - ((Form)this.TopLevelControl).Close(); + if (new FileInfo(Path.Combine(currentDirectory, txtSave.Text)).Extension == onlyViewExtension) + { + Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; + } - } else { - ReturnType(new FileInfo(currentDirectory + "\\" + mainView.FocusedItem.Text).Extension); + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - switch (fileType) { - case 1: - //ManageTextFile.OpenNewTextFile(currentDirectory + "\\" + mainView.FocusedItem.Text); - break; - } - } + ((Form)this.TopLevelControl).Close(); } - - } catch (Exception ex) { + } catch { } } @@ -492,11 +490,9 @@ namespace TimeHACK.OS.Win95.Win95Apps if (diskView.FocusedItem.Text == "My Computer") { GoToDir(ProfileFileSystemDirectory); - } - - } catch (Exception ex) { + } catch { } } @@ -540,24 +536,42 @@ namespace TimeHACK.OS.Win95.Win95Apps private void Button1_Click(object sender, EventArgs e) { - if (txtSave.Text == "") - { - wm.startInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info); - } - else + try { - if (new FileInfo(currentDirectory + "\\" + txtSave.Text).Extension == onlyViewExtension) + Boolean OpenFile = false; + if (mainView.FocusedItem != null) { + if ((String)mainView.FocusedItem.Tag != "") + { // If it isn't a file + GoToDir(currentDirectory + "\\" + mainView.FocusedItem.Tag); + } + else OpenFile = true; // If it is a file + } + else OpenFile = true; + if (OpenFile == true) + { + if (txtSave.Text == "") + { + wm.startInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info); + } + else + { + if (new FileInfo(currentDirectory + "\\" + txtSave.Text).Extension == onlyViewExtension) + { - Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; + Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; + + } - } - - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; + + ((Form)this.TopLevelControl).Close(); + } + } + } catch { - ((Form)this.TopLevelControl).Close(); } } @@ -565,7 +579,7 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (!File.Exists(currentDirectory + mainView.FocusedItem.Text)) + if (!File.Exists(Path.Combine(currentDirectory, mainView.FocusedItem.Text))) { wm.startInfobox95("Windows Explorer", "This directory doesn't exist", Properties.Resources.Win95Info); } @@ -586,11 +600,48 @@ namespace TimeHACK.OS.Win95.Win95Apps { ((Form)this.TopLevelControl).Close(); } - private void AboutWindows95ToolStripMenuItem_Click(object sender, EventArgs e) { WindowManager wm = new WindowManager(); wm.startAboutBox95("Windows 95", "Microsoft Windows 95 Rev B", Properties.Resources.WinClassicAbout95); } + + private void RenameToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + // The AfterLabelEdit event will kick in after this + oldLabelText = mainView.FocusedItem.Text; + mainView.LabelEdit = true; + mainView.FocusedItem.BeginEdit(); + } catch + { + + } + } + + private void mainView_AfterLabelEdit(object sender, LabelEditEventArgs e) + { + + String setText; + setText = mainView.FocusedItem.Text; + if (setText == "") + { + wm.startInfobox95("Windows Explorer", "Please enter a new directory name", Properties.Resources.Win95Info); + } + else + { + if (Directory.Exists(setText)) + { + wm.startInfobox95("Windows Explorer", "That directory already exists.", Properties.Resources.Win95Info); + } + else + { + Directory.Delete(Path.Combine(currentDirectory, oldLabelText), true); + Directory.CreateDirectory(Path.Combine(currentDirectory, setText)); + } + } + RefreshAll(); + } } } diff --git a/TimeHACK.Main/obj/Release/CoreCompileInputs.cache b/TimeHACK.Main/obj/Release/CoreCompileInputs.cache index 854ec49..c80d83d 100644 --- a/TimeHACK.Main/obj/Release/CoreCompileInputs.cache +++ b/TimeHACK.Main/obj/Release/CoreCompileInputs.cache @@ -1 +1 @@ -025d69c9107d161f275b5b459aad08f6b0cc582e +7e1dc210a348e105ac605d4b310d851298fbe398 diff --git a/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferences.cache b/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferences.cache Binary files differindex 9be29b0..6ee910d 100644 --- a/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferences.cache +++ b/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferences.cache diff --git a/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache Binary files differindex 0a5b620..433346f 100644 --- a/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache +++ b/TimeHACK.Main/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache |
