aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs115
1 files changed, 32 insertions, 83 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
index 2c84133..e8f97a0 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs
@@ -19,10 +19,8 @@ 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();
@@ -116,12 +114,12 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
if (new FileInfo(str).Extension == onlyViewExtension)
{
- this.mainView.Items.Add(Path.GetFileName(str), 2);
+ this.mainView.Items.Add(Path.GetFileName(str), 0);
}
}
} else {
if (!(Path.GetFileName(str) == "_data.info")) {
- this.mainView.Items.Add(Path.GetFileName(str), 2);
+ this.mainView.Items.Add(Path.GetFileName(str));
}
}
}
@@ -429,7 +427,6 @@ 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();
@@ -467,18 +464,23 @@ 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 (new FileInfo(Path.Combine(currentDirectory, txtSave.Text)).Extension == onlyViewExtension)
- {
- Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text;
- }
+ if (IsFileOpenDialog == true || IsFileSaveDialog == true) { // If it is a open/save file dialog box
+ Program.WindowsExplorerReturnPath = currentDirectory + "\\" + mainView.FocusedItem.Text;
+ ((Form)this.TopLevelControl).Close();
+ } else {
- FileDialogBoxManager.IsInOpenDialog = false;
- FileDialogBoxManager.IsInSaveDialog = false;
+ ReturnType(new FileInfo(currentDirectory + "\\" + mainView.FocusedItem.Text).Extension);
- ((Form)this.TopLevelControl).Close();
+ switch (fileType) {
+ case 1:
+ //ManageTextFile.OpenNewTextFile(currentDirectory + "\\" + mainView.FocusedItem.Text);
+ break;
+ }
+ }
}
- } catch {
+
+ } catch (Exception ex) {
}
}
@@ -490,9 +492,11 @@ namespace TimeHACK.OS.Win95.Win95Apps
if (diskView.FocusedItem.Text == "My Computer") {
GoToDir(ProfileFileSystemDirectory);
+
}
- } catch {
+
+ } catch (Exception ex) {
}
}
@@ -536,42 +540,24 @@ namespace TimeHACK.OS.Win95.Win95Apps
private void Button1_Click(object sender, EventArgs e)
{
- try
+ if (txtSave.Text == "")
{
- 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)
+ wm.startInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info);
+ }
+ else
+ {
+ if (new FileInfo(currentDirectory + "\\" + txtSave.Text).Extension == onlyViewExtension)
{
- 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;
-
- ((Form)this.TopLevelControl).Close();
- }
}
- } catch {
+
+ FileDialogBoxManager.IsInOpenDialog = false;
+ FileDialogBoxManager.IsInSaveDialog = false;
+
+ ((Form)this.TopLevelControl).Close();
}
}
@@ -579,7 +565,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
try
{
- if (!File.Exists(Path.Combine(currentDirectory, mainView.FocusedItem.Text)))
+ if (!File.Exists(currentDirectory + mainView.FocusedItem.Text))
{
wm.startInfobox95("Windows Explorer", "This directory doesn't exist", Properties.Resources.Win95Info);
}
@@ -600,48 +586,11 @@ 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();
- }
}
}