internal static void Hide(string file) { if (Mainframe.IsFileExists(file)) { File.SetAttributes(file, FileAttributes.Hidden | File.GetAttributes(file)); } }
internal static void DeleteFile(string file) { if (Mainframe.IsFileExists(file)) { try { File.Delete(file); } catch (Exception exception) { Tracer.Report("Mainframe.DeleteFile", exception); } } }
private static CircuitProject Create(Mainframe mainframe, string file) { bool useAutoSaveFile = false; string autoSaveFile = Mainframe.AutoSaveFile(file); if (Mainframe.IsFileExists(autoSaveFile)) { App.Dispatch(() => { MessageBoxResult result = DialogMessage.Show( mainframe, Properties.Resources.TitleApplication, Properties.Resources.MessageLoadAutoSavedFile(file), null, MessageBoxImage.Question, MessageBoxButton.YesNo ); if (result == MessageBoxResult.Yes) { useAutoSaveFile = true; } }); if (!useAutoSaveFile) { Mainframe.DeleteFile(autoSaveFile); } } if (!useAutoSaveFile) { autoSaveFile = file; } CircuitProject project = CircuitProject.Create(autoSaveFile); if (useAutoSaveFile) { project.InOmitTransaction(() => {}); } return(project); }