logo
VitNX3 Documentation

# VitNX_TreeView.Dispose Method

Namespace: VitNX.UI.ControlsV1.Controls
Assembly: VitNX3 (in VitNX3.dll)
Releases the unmanaged resources used by the Control and its child controls and optionally releases the managed resources.
VB
C#
F#
C++
JScript
Copy

    protected override void Dispose(
       bool disposing
    )

    This language is not supported or no code example is available.

#### Parameters

disposing
  bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Source code
VB
C#
F#
C++
JScript
Copy

    protected override void Dispose(bool disposing)
     {
         if (!_disposed)
         {
             DisposeIcons();

             if (SelectedNodesChanged != null)
                 SelectedNodesChanged = null;

             if (AfterNodeExpand != null)
                 AfterNodeExpand = null;

             if (AfterNodeCollapse != null)
                 AfterNodeExpand = null;

             if (_nodes != null)
                 _nodes.Dispose();

             if (_selectedNodes != null)
                 _selectedNodes.CollectionChanged -= SelectedNodes_CollectionChanged;

             _disposed = true;
         }

         base.Dispose(disposing);
     }

    This language is not supported or no code example is available.

Applies to

#### .NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

#### .NET Core

Supported in: 5.0+, 6.0+
See Also
VitNX_TreeView Class
VitNX.UI.ControlsV1.Controls Namespace