示例#1
0
 private void EditorClosing(object sender, FormClosingEventArgs e)
 {
     foreach (var doc in DocumentManager.Documents.ToArray())
     {
         if (!PromptForChanges(doc))
         {
             e.Cancel = true;
             return;
         }
     }
     SidebarManager.SaveLayout();
     ViewportManager.SaveLayout();
     SettingsManager.SaveSession(DocumentManager.Documents.Select(x => Tuple.Create(x.MapFile, x.Game)));
     SettingsManager.Write();
 }
示例#2
0
 private void EditorClosing(object sender, FormClosingEventArgs e)
 {
     foreach (var doc in DocumentManager.Documents.ToArray())
     {
         if (!PromptForChanges(doc))
         {
             e.Cancel = true;
             return;
         }
     }
     SidebarManager.SaveLayout();
     ViewportManager.SaveLayout();
     SettingsManager.SaveSession(DocumentManager.Documents.Select(x => Tuple.Create(x.MapFile, x.Game)));
     SettingsManager.Write();
     if (_updateExecutable != null && File.Exists(_updateExecutable))
     {
         var loc = Path.GetDirectoryName(typeof(Editor).Assembly.Location);
         Process.Start(_updateExecutable, "/S" + (loc != null ? " /D=" + loc : ""));
     }
 }