fixed not all icons showing

This commit is contained in:
lempamo 2017-08-05 08:29:30 -04:00
parent 00308c81c9
commit 4084b7f6e8
4 changed files with 20 additions and 18 deletions

View file

@ -168,10 +168,10 @@ public static void CheckFiles()
SaveDirectoryInfo(ProfileProgramsDirectory, "The Microsoft Network", true, "The Microsoft Network", true);
SaveDirectoryInfo(ProfileMyComputerDirectory, "Windows", true, "Windows", true);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad", 16, 183296);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie", 8, 512);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller", 8, 512);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900", 12, 4);
CreateWindowsDirectory();
}
@ -186,7 +186,6 @@ public static void CreateWindowsDirectory()
SaveDirectoryInfo(ProfileWindowsDirectory, "Temp", true, "Temp", true);
SaveDirectoryInfo(ProfileWindowsDirectory, "Desktop", true, "Desktop", true);
CreateWindowsFile(ProfileWindowsDirectory, "c", "", 8, 515);
CreateWindowsFile(ProfileWindowsDirectory, "calc.exe", "calc", 13, 59392);
CreateWindowsFile(ProfileWindowsDirectory, "emm386.exe", "emm386", 10, 125495);
CreateWindowsFile(ProfileWindowsDirectory, "explorer.exe", "explorer", 0, 204288);
@ -196,7 +195,7 @@ public static void CreateWindowsDirectory()
CreateWindowsFile(ProfileWindowsDirectory, "write.exe", "wordpad", 16, 5120);
}
public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon = 8, int bytes = 512)
public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon, int bytes)
{
File.WriteAllText(Path.Combine(filepath, filename), contents);
THFileInfo info = new THFileInfo();
@ -251,7 +250,7 @@ public static void UpgradeFileSystem(string oldOS, string newOS)
// Add Address Book into existance!
SaveDirectoryInfo(ProfileProgramsDirectory, "Outlook Express", false, "Outlook Express", true);
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook");
CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook", 8, 512);
// There is no "The Microsoft Network" folder!

View file

@ -38,10 +38,10 @@ private void dlTimer_Tick(object sender, EventArgs e)
switch (appName.Text)
{
case "Downloading: FTP Client":
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "FTP Client Setup.exe", "ftp client setup", 11);
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "FTP Client Setup.exe", "ftp client setup", 11, 56291);
break;
case "Downloading: Web Chat 1998":
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "Web Chat Setup.exe", "web chat setup", 11);
CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "Web Chat Setup.exe", "web chat setup", 11, 34846);
break;
}
/* if (appName.Text == "Downloading: Guess The Number")

View file

@ -150,24 +150,24 @@ void RefreshAll() {
itm = this.mainView.Items.Add(Path.GetFileName(str));
itm.Tag = str;
}
else return;
else break;
}
else return;
} else {
else break;
}
else {
if (!(Path.GetFileName(str) == "_data.info"))
{
itm = this.mainView.Items.Add(Path.GetFileName(str));
itm.Tag = str;
}
else return;
else break;
}
FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info")));
foreach(var item in fsfi.Files)
foreach (var item in fsfi.Files)
{
Debug.Print(item.Name + " " + Path.GetFileName(str));
if (item.Name == Path.GetFileName(str)) { itm.ImageIndex = item.FileIcon; return; }
if (item.Name == Path.GetFileName(str)) { itm.ImageIndex = item.FileIcon; break; }
}
itm.ImageIndex = 8;
}
} catch (Exception ex) {
//wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later

View file

@ -110,10 +110,13 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
ActivateSaveFileDialog(".txt");
string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath();
List<string> pathList = selectedPath.Split('\\').ToList();
pathList.RemoveAt(selectedPath.Split('\\').Count() - 1);
if (selectedPath != "")
{
File.WriteAllText(selectedPath, mainText.Text);
SaveSystem.CreateWindowsFile(pathList.ToString(), selectedPath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length);
//File.WriteAllText(selectedPath, mainText.Text);
}
} catch {
}