/// <summary> /// Method that is called when then document context changed. This will remove the object mananger /// of the document from the document manager if the document is closed. /// </summary> /// <param name="sender"> The object that raises the event. </param> /// <param name="e"> The event data. </param> private static void OnContextChanged(object sender, GH_DocContextEventArgs e) { string documentID = DocumentManager.GetRobotComponentsDocumentID(e.Document); if (e.Context == GH_DocumentContext.Close && ObjectManagers.ContainsKey(documentID)) { ObjectManagers.Remove(documentID); } }
private void ContextChanged(object sender, GH_DocContextEventArgs e) { InActiveDocument = e.Document == _doc && e.Context == GH_DocumentContext.Loaded; }