From cc07981aa3603c74507c9ea0acb6dd0d8418d58e Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 4 Nov 2017 17:48:05 +0000 Subject: [PATCH] Address Book can now save data! --- Histacom2.Engine/FileDialogBoxManager.cs | 12 +- Histacom2.Engine/UI/ClassicDropDown.cs | 4 +- .../Win95/Win95Apps/Win95WindowsExplorer.cs | 21 ++- .../FRMWinClassicAddressBookNewContact.cs | 8 +- .../WinClassicAddressBook.Designer.cs | 2 + .../AddressBook/WinClassicAddressBook.cs | 157 ++++++++++++++---- .../Win98Apps/WinClassicWindowsExplorer.cs | 51 +++--- 7 files changed, 180 insertions(+), 75 deletions(-) diff --git a/Histacom2.Engine/FileDialogBoxManager.cs b/Histacom2.Engine/FileDialogBoxManager.cs index 9f0b2ce..d4d025c 100644 --- a/Histacom2.Engine/FileDialogBoxManager.cs +++ b/Histacom2.Engine/FileDialogBoxManager.cs @@ -12,27 +12,27 @@ public static class FileDialogBoxManager { public static bool IsInOpenDialog = false; public static bool IsInSaveDialog = false; - public static string OnlyViewExtension = ""; + public static List OnlyViewExtension = new List(); - public static void ActivateOpenFileDialog(string ExtensionToView) + public static void ActivateOpenFileDialog(params string[] ExtensionToView) { IsInOpenDialog = true; IsInSaveDialog = false; - OnlyViewExtension = ExtensionToView; + OnlyViewExtension = ExtensionToView.ToList(); } - public static void ActivateSaveFileDialog(string ExtensionToView) + public static void ActivateSaveFileDialog(params string[] ExtensionToView) { IsInOpenDialog = false; IsInSaveDialog = true; - OnlyViewExtension = ExtensionToView; + OnlyViewExtension = ExtensionToView.ToList(); } public static void DeactivateFileDialog() { IsInOpenDialog = false; IsInSaveDialog = false; - OnlyViewExtension = ""; + OnlyViewExtension = new List(); } public static string ReadTextFile(string path) diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs index 93b4a62..edf2268 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -34,7 +34,7 @@ public override string Text public static Color _lightBack = Color.Silver; public static Color _darkBack = Color.Silver; - public List items = new List { "TestItem" }; + public List Items { get; set; } = new List(); public ClassicDropDown() { @@ -117,7 +117,7 @@ public void ShowHideDropDown() } else { thisOverlay = new DropDownOverlay(); int applyHeight = 0; - foreach (string str in items) + foreach (string str in Items) { DropDownItem itm = new DropDownItem(); itm.ChangeText(str, Font); diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 4efdd6f..1ac4512 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -22,14 +22,12 @@ public partial class Win95WindowsExplorer : UserControl { public bool IsFileOpenDialog = false; public bool IsFileSaveDialog = false; - public string onlyViewExtension = ""; + public List onlyViewExtension = new List(); string ToReplaceWith = ProfileDirectory; public string CurrentDirectory = ProfileMyComputerDirectory; string OldLabelText; string CurrentCopyFile; - - int fileType = 6; //string attemptedDirectory = ""; WindowManager wm = new WindowManager(); @@ -89,7 +87,8 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e) Properties.Resources.TimeDistorter1, Properties.Resources.WinClassicGTN, Properties.Resources.WinClassicFTP, - Properties.Resources.WinClassicRtfFile}); //20 + Properties.Resources.WinClassicRtfFile, // 20 + Properties.Resources.WinClassicAddressBook}); program.BringToFront(); @@ -124,6 +123,9 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e) } onlyViewExtension = FileDialogBoxManager.OnlyViewExtension; + + foreach (string str in onlyViewExtension) + cmbType.Items.Add(str); } string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) { @@ -162,7 +164,7 @@ private void RefreshAll() { if (!(Path.GetFileName(str) == "_data.info")) { - if (new FileInfo(str).Extension == onlyViewExtension) + if (onlyViewExtension.Contains(new FileInfo(str).Extension)) { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; @@ -232,8 +234,7 @@ public void OpenFile(string fileDir) { try { - ReturnType(new FileInfo(fileDir).Extension); - switch (fileType) + switch (ReturnType(new FileInfo(fileDir).Extension)) { case 1: WinClassicNotepad np = new WinClassicNotepad(); @@ -501,7 +502,7 @@ void mainView_DoubleClick(object sender, EventArgs e) { // If it is a file if (IsFileOpenDialog || IsFileSaveDialog) { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) + if (onlyViewExtension.Contains(new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension)) { Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); } @@ -513,9 +514,7 @@ void mainView_DoubleClick(object sender, EventArgs e) ((Form)this.TopLevelControl).Close(); } else - { OpenFile(mainView.FocusedItem.Tag.ToString()); - } } } catch { /* TODO: Illegal operation */ } } @@ -595,7 +594,7 @@ private void btnSave_Click(object sender, EventArgs e) if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); else { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + if (onlyViewExtension.Contains(new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension)) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); FileDialogBoxManager.IsInOpenDialog = false; FileDialogBoxManager.IsInSaveDialog = false; diff --git a/Histacom2/OS/Win98/Win98Apps/AddressBook/FRMWinClassicAddressBookNewContact.cs b/Histacom2/OS/Win98/Win98Apps/AddressBook/FRMWinClassicAddressBookNewContact.cs index 9facd7b..45384fa 100644 --- a/Histacom2/OS/Win98/Win98Apps/AddressBook/FRMWinClassicAddressBookNewContact.cs +++ b/Histacom2/OS/Win98/Win98Apps/AddressBook/FRMWinClassicAddressBookNewContact.cs @@ -7,12 +7,13 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; - +using Histacom2.Engine; namespace Histacom2.OS.Win95.Win95Apps { public partial class FRMWinClassicAddressBookNewContact : UserControl { + WindowManager wm = new WindowManager(); public AddressBookContact toSet = new AddressBookContact(); public FRMWinClassicAddressBookNewContact() { @@ -37,7 +38,7 @@ private void button1_Click(object sender, EventArgs e) Program.AddressBookSelectedContact = toSet; ((Form)this.TopLevelControl).Close(); } else { - MessageBox.Show("Please fill out the First, Middle and Last name."); + wm.StartInfobox95("Address Book", "Please fill out the First, Middle and Last name.", Engine.Template.InfoboxType.Info, Engine.Template.InfoboxButtons.OK); } } @@ -62,9 +63,6 @@ private void FRMWinClassicAddressBookNewContact_Load(object sender, EventArgs e) emails.Items.Add(email); } } - } else - { - MessageBox.Show("NULL CONTACT!"); } } } diff --git a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs index 09030fb..5452184 100644 --- a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs @@ -145,12 +145,14 @@ private void InitializeComponent() this.importToolStripMenuItem.Name = "importToolStripMenuItem"; this.importToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.importToolStripMenuItem.Text = "Import..."; + this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exportToolStripMenuItem.Text = "Export..."; + this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // // toolStripSeparator3 // diff --git a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs index e4d6c7b..bf4f648 100644 --- a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs +++ b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs @@ -9,6 +9,9 @@ using System.Windows.Forms; using Histacom2.Engine; using Histacom2.Engine.Template; +using System.IO; +using static Histacom2.Engine.SaveSystem; +using static Histacom2.Engine.FileDialogBoxManager; namespace Histacom2.OS.Win95.Win95Apps { @@ -42,14 +45,30 @@ public WinClassicAddressBook() { new AddressBookContactList() { - AttachedNode = treeView1.Nodes[0].Text + NodePath = treeView1.Nodes[0].Text } }; + + if (File.Exists(Path.Combine(ProfileWindowsDirectory, "Application Data", "Microsoft", "Address Book", $"{ProfileName}.wab"))) + LoadData(); + else + SaveData(); + + } private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { - UpdateContactListFromNodeName(treeView1.SelectedNode.Text); + previousParent = treeView1.SelectedNode.Parent; + UpdateContactListFromNodeName(treeView1.SelectedNode); + + // Remove the focus from contactsView + + if (contactsView.SelectedItems.Count != 0) + contactsView.SelectedItems[0].Selected = false; + + if (contactsView.FocusedItem != null) + contactsView.FocusedItem.Focused = false; } //AddressBookContactList GetAddressBookContactListFromNode(string NodeText) @@ -71,14 +90,15 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) // return toReturn; //} - public void UpdateContactListFromNodeName(string NodeName) + public void UpdateContactListFromNodeName(TreeNode Node) { + previousParent = Node.Parent; contactsView.Items.Clear(); try { foreach (AddressBookContactList ContactList in AddressBookObjects) { - if (ContactList.AttachedNode == NodeName) + if (ContactList.NodePath == FindNodePath(Node)) { foreach (AddressBookContact contact in ContactList.Contacts) { @@ -97,15 +117,29 @@ public void AddFolderToNode(TreeNode OldTreeNode, string NewNodeName) { if (OldTreeNode != null) { - OldTreeNode.Nodes.Add(NewNodeName); + TreeNode nde = OldTreeNode.Nodes.Add(NewNodeName); AddressBookObjects.Add(new AddressBookContactList { - AttachedNode = NewNodeName, + NodePath = FindNodePath(nde) }); } } + TreeNode previousParent; + public string FindNodePath(TreeNode nde) + { + if (nde != null) + { + string ret = nde.Text; + previousParent = nde.Parent; + while (previousParent != null) + ret = $"{FindNodePath(nde.Parent)}\\{ret}"; + return ret; + } + else return ""; + } + private void newFolderToolStripMenuItem_Click(object sender, EventArgs e) { NewFolder(); @@ -145,7 +179,7 @@ void NewContact() { foreach (AddressBookContactList ContactList in AddressBookObjects) { - if (ContactList.AttachedNode == treeView1.SelectedNode.Text) + if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode)) { ContactList.Contacts.Add(Program.AddressBookSelectedContact); contactsView.Items.Add(Program.AddressBookSelectedContact.FirstName + " " + Program.AddressBookSelectedContact.MiddleName + " " + Program.AddressBookSelectedContact.LastName); @@ -169,7 +203,7 @@ void OpenProperties() { foreach (AddressBookContactList ContactList in AddressBookObjects) { - if (ContactList.AttachedNode == treeView1.SelectedNode.Text) + if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode)) { foreach (AddressBookContact Contact in ContactList.Contacts) { @@ -195,7 +229,7 @@ void OpenProperties() { foreach (AddressBookContactList ContactList in AddressBookObjects) { - if (ContactList.AttachedNode == treeView1.SelectedNode.Text) + if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode)) { foreach (AddressBookContact Contact in ContactList.Contacts) { @@ -228,31 +262,31 @@ void DeleteContact() { try { - if (treeView1.SelectedNode != null) + foreach (AddressBookContactList ContactList in AddressBookObjects) { - foreach (AddressBookContactList ContactList in AddressBookObjects) + if (ContactList.NodePath == FindNodePath(treeView1.SelectedNode)) { - if (ContactList.AttachedNode == treeView1.SelectedNode.Text) + foreach (AddressBookContact Contact in ContactList.Contacts) { - foreach (AddressBookContact Contact in ContactList.Contacts) - { - if (contactsView.FocusedItem == null) - { // Most likely they are trying to delete a whole folder! - if (treeView1.SelectedNode.Text != "Shared Contacts") - if (treeView1.SelectedNode != null) - { - AddressBookObjects.Remove(ContactList); - treeView1.Nodes.Remove(treeView1.SelectedNode); - UpdateContactListFromNodeName("Shared Contacts"); - } - } - else - { - if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text) + if (contactsView.FocusedItem == null) + { // Most likely they are trying to delete a whole folder! + if (treeView1.SelectedNode.Text != "Shared Contacts") + if (treeView1.SelectedNode != null) { - ContactList.Contacts.Remove(Contact); + AddressBookObjects.Remove(ContactList); + treeView1.Nodes.Remove(treeView1.SelectedNode); + previousParent = null; + UpdateContactListFromNodeName(treeView1.Nodes[0]); } - } + } + else + { + if ((Contact.FirstName + " " + Contact.MiddleName + " " + Contact.LastName) == contactsView.FocusedItem.Text) + { + ContactList.Contacts.Remove(Contact); + previousParent = treeView1.SelectedNode.Parent; + UpdateContactListFromNodeName(treeView1.SelectedNode); + } } } } @@ -310,14 +344,75 @@ private void WinClassicAddressBook_Load(object sender, EventArgs e) public void SaveData() { - + string toSave = Newtonsoft.Json.JsonConvert.SerializeObject(AddressBookObjects, Newtonsoft.Json.Formatting.Indented); + CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Application Data", "Microsoft", "Address Book"), $"{ProfileName}.wab", toSave, 21, toSave.Length); } public void SaveDataAs() { + try + { + string toSave = Newtonsoft.Json.JsonConvert.SerializeObject(AddressBookObjects, Newtonsoft.Json.Formatting.Indented); + ActivateSaveFileDialog(".wab"); + string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); + + if (selectedPath != "") + CreateWindowsFile(new FileInfo(selectedPath).Directory.FullName, selectedPath.Split('\\').Last(), toSave, 21, toSave.Length); + } catch { } + } + + public void LoadData() + { + AddressBookObjects = Newtonsoft.Json.JsonConvert.DeserializeObject>(File.ReadAllText(Path.Combine(ProfileWindowsDirectory, "Application Data", "Microsoft", "Address Book", $"{ProfileName}.wab"))); + + foreach (AddressBookContactList lst in AddressBookObjects) + UpdateTreeView(lst); } + public void LoadDataAs() + { + ActivateOpenFileDialog(".wab"); + string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); + + if (selectedPath != "") + AddressBookObjects = Newtonsoft.Json.JsonConvert.DeserializeObject>(File.ReadAllText(selectedPath)); + + foreach (AddressBookContactList lst in AddressBookObjects) + UpdateTreeView(lst); + } + + TreeNode UpdatePrevParent; + public void UpdateTreeView(AddressBookContactList lst, int count = 0) + { + try + { + string[] parts = lst.NodePath.Split('\\'); + if (count == 0) UpdatePrevParent = treeView1.Nodes[0]; + if (lst.NodePath != FindNodePath(treeView1.Nodes[0])) + { + if (UpdatePrevParent.Nodes.ContainsKey(parts[count + 1])) + UpdatePrevParent.Nodes.RemoveByKey(parts[count + 1]); + + TreeNode newNde = UpdatePrevParent.Nodes.Add(parts[count + 1], parts[count + 1]); + UpdatePrevParent = newNde; + if (count != parts.Length - 2) UpdateTreeView(lst, ++count); + } + + } catch { } + } + + private void importToolStripMenuItem_Click(object sender, EventArgs e) + { + LoadDataAs(); + } + + private void exportToolStripMenuItem_Click(object sender, EventArgs e) + { + SaveDataAs(); + } } public class AddressBookContact @@ -330,7 +425,7 @@ public class AddressBookContact public class AddressBookContactList { - public string AttachedNode; + public string NodePath; public List Contacts = new List(); } } diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index c7369b4..947f9ba 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -22,13 +22,12 @@ public partial class WinClassicWindowsExplorer : UserControl { public bool IsFileOpenDialog = false; public bool IsFileSaveDialog = false; - public string onlyViewExtension = ""; + public List onlyViewExtension = new List(); string ToReplaceWith = ProfileDirectory; public string CurrentDirectory = ProfileMyComputerDirectory; string OldLabelText; string CurrentCopyFile; - int fileType = 6; //string attemptedDirectory = ""; WindowManager wm = new WindowManager(); @@ -82,7 +81,8 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e) Properties.Resources.TimeDistorter1, Properties.Resources.WinClassicGTN, Properties.Resources.WinClassicFTP, - Properties.Resources.WinClassicRtfFile}); //20 + Properties.Resources.WinClassicRtfFile, // 20 + Properties.Resources.WinClassicAddressBook}); program.BringToFront(); @@ -117,6 +117,11 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e) } onlyViewExtension = FileDialogBoxManager.OnlyViewExtension; + + foreach (string str in onlyViewExtension) + cmbType.Items.Add(str); + + cmbType.Text = onlyViewExtension.FirstOrDefault(); } //'Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) @@ -157,6 +162,19 @@ void RefreshAll() { //try { this.mainView.Items.Clear(); + if (CurrentDirectory == ProfileFileSystemDirectory) + { + txtInfoTitle.Text = "My Computer"; + pictureBox1.Image = Properties.Resources.Win95ComputerIcon; + } else if (CurrentDirectory == ProfileMyComputerDirectory) { + txtInfoTitle.Text = "C:"; + pictureBox1.Image = Properties.Resources.WinClassicFolderSmall; // TODO: ADD DRIVE ICON + } else { + txtInfoTitle.Text = Path.GetFileName(CurrentDirectory); + pictureBox1.Image = Properties.Resources.WinClassicFolderSmall; + } + + foreach (string str in Directory.GetDirectories(CurrentDirectory)) { string label = ReadDataFile(str, false); @@ -172,14 +190,14 @@ void RefreshAll() { { if (!(Path.GetFileName(str) == "_data.info")) { - if (new FileInfo(str).Extension == onlyViewExtension) + if (onlyViewExtension.Contains(new FileInfo(str).Extension)) { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else break; + else continue; } - else break; + else continue; } else { @@ -188,7 +206,7 @@ void RefreshAll() { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else break; + else continue; } FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); foreach (var item in fsfi.Files) @@ -244,8 +262,7 @@ public void OpenFile(string fileDir) { try { - ReturnType(new FileInfo(fileDir).Extension); - switch (fileType) + switch (ReturnType(new FileInfo(fileDir).Extension)) { case 1: WinClassicNotepad np = new WinClassicNotepad(); @@ -452,7 +469,7 @@ void mainView_DoubleClick(object sender, EventArgs e) { // If it is a file if (IsFileOpenDialog || IsFileSaveDialog) { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) + if (onlyViewExtension.Contains(new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension)) { Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); } @@ -464,9 +481,7 @@ void mainView_DoubleClick(object sender, EventArgs e) ((Form)this.TopLevelControl).Close(); } else - { OpenFile(mainView.FocusedItem.Tag.ToString()); - } } } catch { /* TODO: Illegal operation */ } } @@ -477,7 +492,7 @@ void diskView_AfterSelect(object sender, EventArgs e) { if (diskView.SelectedNode != null) { - if (diskView.SelectedNode.Text == "My Computer") + if (diskView.SelectedNode.Text == "My Computer" || diskView.SelectedNode.Text == "Desktop") { GoToDir(ProfileFileSystemDirectory); } @@ -491,11 +506,7 @@ void diskView_AfterSelect(object sender, EventArgs e) { // It is a directory: - try - { - GoToDir(diskView.SelectedNode.Tag.ToString()); - } - catch { } + GoToDir(diskView.SelectedNode.Tag.ToString()); } } } @@ -540,7 +551,7 @@ private void Button1_Click(object sender, EventArgs e) if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); else { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + if (onlyViewExtension.Contains(new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension)) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); FileDialogBoxManager.IsInOpenDialog = false; FileDialogBoxManager.IsInSaveDialog = false; @@ -980,7 +991,7 @@ private void btnSave_Click(object sender, EventArgs e) if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); else { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + if (onlyViewExtension.Contains(new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension)) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); FileDialogBoxManager.IsInOpenDialog = false; FileDialogBoxManager.IsInSaveDialog = false;