ARCed.UI.DockPane.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                this.m_dockState = DockState.Unknown;

                if (this.NestedPanesContainer != null)
                    this.NestedPanesContainer.NestedPanes.Remove(this);

                if (this.DockPanel != null)
                {
                    this.DockPanel.RemovePane(this);
                    this.m_dockPanel = null;
                }

                this.Splitter.Dispose();
                if (this.m_autoHidePane != null)
                    this.m_autoHidePane.Dispose();
            }
            base.Dispose(disposing);
        }

Usage Example

 private void RemoveFromPane(DockPane pane)
 {
     pane.RemoveContent(this.Content);
     this.SetPane(null);
     if (pane.Contents.Count == 0)
         pane.Dispose();
 }