public void LoadSettings() { if (StopSavesAndLoads) { return; } string fileName = FileManager.UserApplicationDataForThisApplication + "FileAssociationSettings.xml"; if (FileManager.FileExists(fileName)) { FileAssociationsSave fas = FileManager.XmlDeserialize <FileAssociationsSave>(fileName); mAvailableApplications.Clear(); mExtensionApplicationAssociations.Clear(); mAvailableApplications = fas.AvailableApplications; for (int i = 0; i < fas.Extensions.Count; i++) { mExtensionApplicationAssociations.Add(fas.Extensions[i], fas.AssociatedApplications[i]); } AddDefaults(); } }
public void SaveSettings() { if (StopSavesAndLoads) { return; } FileAssociationsSave fas = new FileAssociationsSave(); fas.AvailableApplications = mAvailableApplications; foreach (KeyValuePair <string, string> kvp in mExtensionApplicationAssociations) { fas.Extensions.Add(kvp.Key); fas.AssociatedApplications.Add(kvp.Value); } FileManager.XmlSerialize(fas, FileManager.UserApplicationDataForThisApplication + "FileAssociationSettings.xml"); }