File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed
Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -875,24 +875,36 @@ private ToolStripItem Find(TrayMenuItem item, ToolStripItemCollection items)
875875 #region IDisposableState
876876
877877 /// <summary>
878- /// Returns information the instance is already disposed
878+ /// Gets a value indicating whether the control has been disposed of.
879879 /// </summary>
880880 public bool IsDisposed { get ; private set ; }
881881
882882 /// <summary>
883- /// Dispose the instance
883+ /// Dispose the instance.
884884 /// </summary>
885885 public void Dispose ( )
886886 {
887- if ( IsDisposed )
887+ this . Dispose ( true ) ;
888+ }
889+
890+ /// <summary>
891+ /// Dispose the instance.
892+ /// </summary>
893+ /// <param name="disposing"></param>
894+ protected virtual void Dispose ( bool disposing )
895+ {
896+ if ( this . IsDisposed )
888897 {
889- if ( null != _contextMenu )
890- {
891- _contextMenu . Dispose ( ) ;
892- _contextMenu = null ;
893- }
894- IsDisposed = true ;
898+ return ;
895899 }
900+
901+ if ( disposing )
902+ {
903+ _contextMenu ? . Dispose ( ) ;
904+ _contextMenu = null ;
905+ }
906+
907+ this . IsDisposed = true ;
896908 }
897909
898910 #endregion
You can’t perform that action at this time.
0 commit comments