public void SaveConfig() { if (Directory.Exists(Path.GetDirectoryName(ConfigFilePath))) { string cfgString = ""; cfgString += "CharacterDataFolderPath" + " = " + CharacterDataFolderPath + "\r\n"; cfgString += "DefaultCharacterID" + " = " + DefaultCharacterID + "\r\n"; cfgString += "UpdateCheckFrequency_Days" + " = " + UpdateCheckFrequency_Days.ToString() + "\r\n"; cfgString += "LastUpdateCheck" + " = " + LastUpdateCheck.ToString("u") + "\r\n"; cfgString += "ShowInitialWarning" + " = " + ShowInitialWarning.ToString() + "\r\n"; if (File.Exists(ConfigFilePath)) { File.Copy(ConfigFilePath, ConfigFilePath + ".bak", true); } File.WriteAllText(ConfigFilePath, cfgString); } }
public void SaveConfig() { if (Directory.Exists(Path.GetDirectoryName(ConfigFilePath))) { string cfgString = ""; cfgString += "CharacterDataFolderPath" + " = " + CharacterDataFolderPath + "\r\n"; cfgString += "DefaultCharacterID" + " = " + DefaultCharacterID + "\r\n"; cfgString += "UpdateRequestTimeout_Sec" + " = " + UpdateRequestTimeout_Sec.ToString() + "\r\n"; cfgString += "UpdateCheckFrequency_Days" + " = " + UpdateCheckFrequency_Days.ToString() + "\r\n"; cfgString += "LastUpdateCheck" + " = " + LastUpdateCheck.ToString("u") + "\r\n"; cfgString += "LastConfigUpdateCheck" + " = " + LastConfigUpdateCheck.ToString("u") + "\r\n"; cfgString += "ShowInitialWarning" + " = " + ShowInitialWarning.ToString() + "\r\n"; cfgString += "LastProgramUpdateVersionSeen" + " = " + LastProgramUpdateVersionSeen.ToString() + "\r\n"; cfgString += "EarliestPresetTimestampAllowed" + " = " + EarliestPresetTimestampAllowed.ToString("u") + "\r\n"; if (File.Exists(ConfigFilePath)) { File.Copy(ConfigFilePath, ConfigFilePath + ".bak", true); } File.WriteAllText(ConfigFilePath, cfgString); } }
protected override void SaveData(XElement xmlElement) { AddAttrValue(xmlElement, "LastUpdateCheck", LastUpdateCheck.ToString("s")); AddAttrValue(xmlElement, "LastUpdateFound", LastUpdateFound.ToString("s")); AddAttrValue(xmlElement, "LastUpdateError", LastUpdateError.ToString("s")); }