From 6e993159ddb07803a564e4db911d66c97c45ea40 Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 21 Feb 2018 23:37:38 -0500 Subject: [PATCH] switch-case is a thing, alex. fucking use it --- Histacom2/OS/Win95/Win95.cs | 111 ++++++++++++-------------- Histacom2/OS/WinME/WinME.Designer.cs | 3 +- Histacom2/OS/WinME/WinME.cs | 99 ++++++++++------------- Histacom2/OS/WinME/WinME.resx | 112 +++++++++++++-------------- 4 files changed, 147 insertions(+), 178 deletions(-) diff --git a/Histacom2/OS/Win95/Win95.cs b/Histacom2/OS/Win95/Win95.cs index 0e2ac3b..ad828ba 100644 --- a/Histacom2/OS/Win95/Win95.cs +++ b/Histacom2/OS/Win95/Win95.cs @@ -264,69 +264,60 @@ private void desktopicons_DoubleClick(object sender, EventArgs e) objListViewItem = desktopicons.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); if (objListViewItem != null) { - if (objListViewItem.Text == "Internet Explorer") + switch (objListViewItem.Text) { - if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; } - ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true); - AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4); - ie.BringToFront(); - ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing); - startmenu.Hide(); - } - else if (objListViewItem.Text == "My Computer") // TODO: Implement slightly limited explorer (with no treeview and a new window each time ya go into a dir) - { - WinClassic app = wm.Init(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); - AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - app.BringToFront(); - startmenu.Hide(); - } - else if (objListViewItem.Text == "Network Neighborhood") - { - // Alex's TODO here - - } - else if (objListViewItem.Text == "Recycle Bin") - { - // Another thing you may need to digital poke Alex about doing. - - } - else if (objListViewItem.Text == "Set Up The Microsoft Network") { - wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", InfoboxType.Info, InfoboxButtons.OK); - } else if (objListViewItem.Text == "Outlook Express") { - //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); - } - else if (objListViewItem.Text == "Inbox") - { - //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); - } - else if (objListViewItem.Text == "Online Services") - { - wm.StartInfobox95("Caught it!", "If you were to run this, the game would crash!\nLuckily, it won't crash this time!", InfoboxType.Error, InfoboxButtons.OK); - } - - else - { - // It is an actual file on the disk - - Win95WindowsExplorer we = new Win95WindowsExplorer(); - - // If it is a directory - - if (Directory.Exists(objListViewItem.Tag.ToString())) - { - we.CurrentDirectory = objListViewItem.Tag.ToString(); - - WinClassic app = wm.Init(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); - AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - app.BringToFront(); + case "Internet Explorer": + if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; } + ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true); + AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4); + ie.BringToFront(); + ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing); startmenu.Hide(); - } - else - { - // Just open the file... + break; + case "My Computer": + WinClassic we = wm.Init(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); + AddTaskBarItem(we, we.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); + we.BringToFront(); + startmenu.Hide(); + break; + case "Network Neighborhood": + // Alex's TODO here + break; + case "Recycle Bin": + // Another thing you may need to digital poke Alex about doing. + break; + case "Set Up The Microsoft Network": + wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", InfoboxType.Info, InfoboxButtons.OK); + break; + case "Outlook Express": + //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); + break; + case "Inbox": + //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); + break; + case "Online Services": + wm.StartInfobox95("Caught it!", "If you were to run this, the game would crash!\nLuckily, it won't crash this time!", InfoboxType.Error, InfoboxButtons.OK); + break; + default: + // It is an actual file on the disk + Win95WindowsExplorer wwe = new Win95WindowsExplorer(); - we.OpenFile(objListViewItem.Tag.ToString()); - } + // If it is a directory + if (Directory.Exists(objListViewItem.Tag.ToString())) + { + wwe.CurrentDirectory = objListViewItem.Tag.ToString(); + + WinClassic app = wm.Init(wwe, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); + AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); + app.BringToFront(); + startmenu.Hide(); + } + else + { + // Just open the file... + wwe.OpenFile(objListViewItem.Tag.ToString()); + } + break; } } diff --git a/Histacom2/OS/WinME/WinME.Designer.cs b/Histacom2/OS/WinME/WinME.Designer.cs index 1e5cfef..7ef6b54 100644 --- a/Histacom2/OS/WinME/WinME.Designer.cs +++ b/Histacom2/OS/WinME/WinME.Designer.cs @@ -947,12 +947,11 @@ private void InitializeComponent() // // osimage // - this.osimage.Dock = System.Windows.Forms.DockStyle.Fill; + this.osimage.Dock = System.Windows.Forms.DockStyle.Bottom; this.osimage.Image = global::Histacom2.Properties.Resources.Win95SideBar; this.osimage.Location = new System.Drawing.Point(0, 0); this.osimage.Name = "osimage"; this.osimage.Size = new System.Drawing.Size(21, 265); - this.osimage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.osimage.TabIndex = 0; this.osimage.TabStop = false; // diff --git a/Histacom2/OS/WinME/WinME.cs b/Histacom2/OS/WinME/WinME.cs index 493df52..1470902 100644 --- a/Histacom2/OS/WinME/WinME.cs +++ b/Histacom2/OS/WinME/WinME.cs @@ -263,69 +263,48 @@ private void desktopicons_DoubleClick(object sender, EventArgs e) objListViewItem = desktopicons.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); if (objListViewItem != null) { - if (objListViewItem.Text == "Internet Explorer") + switch (objListViewItem.Text) { - if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; } - ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true); - AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4); - ie.BringToFront(); - ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing); - startmenu.Hide(); - } - else if (objListViewItem.Text == "My Computer") // TODO: Implement slightly limited explorer (with no treeview and a new window each time ya go into a dir) - { - WinClassic app = wm.Init(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); - AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - app.BringToFront(); - startmenu.Hide(); - } - else if (objListViewItem.Text == "Network Neighborhood") - { - // Alex's TODO here - - } - else if (objListViewItem.Text == "Recycle Bin") - { - // Another thing you may need to digital poke Alex about doing. - - } - else if (objListViewItem.Text == "Set Up The Microsoft Network") { - wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", InfoboxType.Info, InfoboxButtons.OK); - } else if (objListViewItem.Text == "Outlook Express") { - //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); - } - else if (objListViewItem.Text == "Inbox") - { - //wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error); - } - else if (objListViewItem.Text == "Online Services") - { - wm.StartInfobox95("Caught it!", "If you were to run this, the game would crash!\nLuckily, it won't crash this time!", InfoboxType.Error, InfoboxButtons.OK); - } - - else - { - // It is an actual file on the disk - - Win95WindowsExplorer we = new Win95WindowsExplorer(); - - // If it is a directory - - if (Directory.Exists(objListViewItem.Tag.ToString())) - { - we.CurrentDirectory = objListViewItem.Tag.ToString(); - - WinClassic app = wm.Init(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); - AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - app.BringToFront(); + case "Internet Explorer": + if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; } + ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true); + AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4); + ie.BringToFront(); + ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing); startmenu.Hide(); - } - else - { - // Just open the file... + break; + case "My Computer": + break; + case "Recycle Bin": + break; + case "Setup MSN Internet Access": + break; + case "Outlook Express": + break; + case "My Network Places": + break; + case "My Documents": + break; + default: + // It is an actual file on the disk + Win95WindowsExplorer we = new Win95WindowsExplorer(); - we.OpenFile(objListViewItem.Tag.ToString()); - } + // If it is a directory + if (Directory.Exists(objListViewItem.Tag.ToString())) + { + we.CurrentDirectory = objListViewItem.Tag.ToString(); + + WinClassic app = wm.Init(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); + AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); + app.BringToFront(); + startmenu.Hide(); + } + else + { + // Just open the file... + we.OpenFile(objListViewItem.Tag.ToString()); + } + break; } } diff --git a/Histacom2/OS/WinME/WinME.resx b/Histacom2/OS/WinME/WinME.resx index de219fa..85bd4ab 100644 --- a/Histacom2/OS/WinME/WinME.resx +++ b/Histacom2/OS/WinME/WinME.resx @@ -121,62 +121,6 @@ 17, 17 - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw - 4AAABIQCQUtXaBsAAAAASUVORK5CYII= - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAALRJREFUOE+N @@ -347,6 +291,62 @@ wQAADsEBuJFr7QAAAJJJREFUOE+tkYEOgCAIRP10/tzk4FISZ7ZuuzDwnq4KJSL1aR/txc21llBfQVbh EZJZZ5C+nEoEcIN0QDyxLVGzm6WAsMYTvRSSAqaw2jRBloApbJUBhLVub4ABqwMY1poCuEYzhPWjRkgK 6EP7A+obqOc2EzIBeELmtqNFDECI9R3gYmPhCPH+qX6HfAJAQ7iUCwlxft5LSoDNAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAMSURBVBhXYzhw + 4AAABIQCQUtXaBsAAAAASUVORK5CYII=