public static bool RestoreDefaults() { string pathFile = instance.GetLogFilePath() + "/" + personalSettingsXmlFile; if (File.Exists(pathFile)) { File.Delete(pathFile); m_instance = null; return true; } return false; }
//Don't reference instance here, use m_instance otherwise we'll possibly create an inf loop public static void LoadSettings() { if (!m_instance.personalSettingsLoaded) { string pathFile = instance.GetLogFilePath() + "/" + personalSettingsXmlFile; if (File.Exists(pathFile)) { var serializer = new XmlSerializer(typeof(AssertDebugConfig)); using (var stream = new FileStream(pathFile, FileMode.Open)) { m_instance = serializer.Deserialize(stream) as AssertDebugConfig; m_instance.personalSettingsLoaded = true; } } } }