Example #1
0
        public static void DropWatchers()
        {
            // clone to avoid concurrency modification errors
            ExternalSnippet[] watchersClone = new ExternalSnippet[Watchers.Count];
            Watchers.CopyTo(watchersClone);

            foreach (ExternalSnippet watcher in watchersClone) {
                watcher.ShutDown();
            }
        }
Example #2
0
 protected override void OnClick(EventArgs e)
 {
     base.OnClick(e);
     if (!botheredForAutosave && !Universe.Instance.mainForm.autoSaveMenu.Checked)
     {
         string message = "Autosave is off. It should be on so that when you save the external file, TheKBase is saved as well. Turn it on?";
         bool result = Universe.Instance.mainForm.ShowDialogYesNo(message);
         if (result)
         {
             Universe.Instance.mainForm.ClickAutoSaveToggle(null, null);
         }
         botheredForAutosave = true;
     }
     if (snippet.WatchSnippet == null)
     {
         Universe.Instance.detailPane.Save();
         ExternalSnippet eSnippet = new ExternalSnippet(snippet);
         snippet.WatchSnippet = eSnippet;
         eSnippet.StartWatching();
         Universe.Instance.detailPane.Edit(snippet);
     }
     else
     {
         snippet.WatchSnippet.popOpen();
     }
     setVisibleState();
 }