Exemple #1
0
 private static async void SaveExtern(CharHolder myChar)
 {
     try
     {
         SharedIO.Save(myChar, new FileInfo(Path.Combine((await SharedIO.CurrentIO.PickFolder()).FullName, myChar.FileInfo.Name)));
     }
     catch (Exception)
     {
         Log.Write(AppResources.Error_FileExportFail, true);
     }
 }
 private static void Instance_MainObjectSaved(object sender, IMainType e)
 {
     Log.Write("MainObjectSaved");
     SettingsModel.I.COUNT_SAVINGS++;
     if (SettingsModel.I.BACKUP_VERSIONING)
     {
         string FileName = (e as CharHolder)?.MakeName(true);
         try
         {
             DirectoryInfo BackUpFolder = new DirectoryInfo(Path.Combine(SharedIO.CurrentSavePath, "BackUp"));
             SharedIO.CurrentIO.CreateFolder(BackUpFolder).Wait();
             FileInfo BackUpFile = new FileInfo(Path.Combine(BackUpFolder.FullName, FileName));
             SharedIO.Save(e, BackUpFile).Wait();
         }
         catch (Exception ex)
         {
             Log.Write("Could not save BackUpChar", ex, logType: LogType.Error);
         }
     }
 }