Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 /// <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);
     }
 }