Пример #1
0
 public bool Save_FMap_Quick()
 {
     if ( PathInfo == null )
     {
         return Save_FMap_Prompt();
     }
     if ( PathInfo.IsFMap )
     {
         var fMap = new FMap (this);
         var result = fMap.Save(PathInfo.Path, true, true);
         if ( !result.HasProblems )
         {
             ChangedSinceSave = false;
         }
         App.ShowWarnings(result);
         return !result.HasProblems;
     }
     return Save_FMap_Prompt();
 }
Пример #2
0
        public clsResult AutoSavePerform()
        {
            var ReturnResult = new clsResult("Autosave", false);

            var DateNow = DateTime.Now;
            var path = string.Format("{0}autosaved-{1}-{2}-{3}-{4}-{5}-{6}-{7}.fmap",
                App.AutoSavePath, DateNow.Year, App.MinDigits(DateNow.Month, 2),
                App.MinDigits(DateNow.Day, 2), App.MinDigits(DateNow.Hour, 2),
                App.MinDigits(DateNow.Minute, 2), App.MinDigits(DateNow.Second, 2),
                App.MinDigits(DateNow.Millisecond, 3));

            logger.Info(string.Format("Autosave to: \"{0}\"", path));

            var fmap = new FMap (this);
            ReturnResult.Add(fmap.Save(path, false, SettingsManager.Settings.AutoSaveCompress));

            return ReturnResult;
        }
Пример #3
0
        public bool Save_FMap_Prompt()
        {
            var Dialog = new SaveFileDialog();

            Dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            Dialog.FileName = "";
            Dialog.Filter = Constants.ProgramName + " Map Files (*.fmap)|*.fmap";
            if ( Dialog.ShowDialog(Program.frmMainInstance) != DialogResult.OK )
            {
                return false;
            }
            SettingsManager.Settings.SavePath = Path.GetDirectoryName(Dialog.FileName);
            var fMap = new FMap (this);
            var result = fMap.Save(Dialog.FileName, true, true);
            if ( !result.HasProblems )
            {
                PathInfo = new clsPathInfo(Dialog.FileName, true);
                ChangedSinceSave = false;
            }
            App.ShowWarnings(result);
            return !result.HasProblems;
        }