/// <summary> /// The form is closed. Clean up. /// </summary> private void _formClosed(object sender, System.Windows.Forms.FormClosedEventArgs args) { try { if (false == this.InvokeRequired) { if (this == CadKit.Documents.Manager.Instance.ActiveView) { CadKit.Documents.Manager.Instance.ActiveView = null; } CadKit.Interfaces.IDocument document = this.Document; CadKit.Viewer.Panel panel = this.Panel; // Call this first because it circles back around and expects the panel to exist. if (null != document) { document.remove(this); this.Document = null; } // Now clear the panel. if (null != panel) { panel.clear(); this.Panel = null; } } } catch (System.Exception e) { System.Console.WriteLine("Error 6554359560: {0}", e.Message); } }
/// <summary> /// Constructor /// </summary> public PropertyProxy(CadKit.Viewer.Panel panel) : base(panel) { if (null == panel) { throw new System.ArgumentException("Error 1955579892: Null panel given to proxy"); } _panel = panel; }