public static void Save(Settings settings) { try { DataContractHelper.SaveToXml(settings, StandardPaths.SettingsFile); } catch (System.Exception e) { string message = string.Format("Failed to save settings.\n{0}", e.Message); Log.Error(message); } }
/// <summary> /// NOTE: filePath is relative to the base puzzle directory. /// </summary> public static void Save(PuzzleConfig config, string filePath) { try { string fullPath = Path.GetFullPath(Path.Combine(StandardPaths.ConfigDir, filePath)); Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); DataContractHelper.SaveToXml(config, fullPath); } catch (System.Exception e) { string message = string.Format("Failed to save puzzle config.\n{0}", e.Message); Log.Error(message); } }