示例#1
0
        public void Save(string file)
        {
            this.Mainframe.ResetAutoSaveTimer();
            string oldFile = this.File;

            if (System.IO.File.Exists(file))
            {
                string temp   = Mainframe.TempFile(file);
                string backup = null;
                if (Settings.User.CreateBackupFileOnSave)
                {
                    backup = Mainframe.BackupFile(file);
                }
                this.CircuitProject.Save(temp);
                System.IO.File.Replace(temp, file, backup);
            }
            else
            {
                this.CircuitProject.Save(file);
            }
            this.File         = file;
            this.savedVersion = this.CircuitProject.Version;
            Mainframe.DeleteAutoSaveFile(oldFile);

            this.NotifyPropertyChanged("Caption");
        }