// -------------------------------------------------------------------------------------------- /// <summary> /// Disposes this object. /// </summary> // -------------------------------------------------------------------------------------------- protected override void Dispose(bool disposing) { if (disposing) { // --- First dispose the dialog container if (_Container != null) { try { _Container.Dispose(); } catch (Exception) { VsDebug.Fail("Failed to dispose container"); } _Container = null; } // --- Dispose the window itself if (_Window != null && _Window is IDisposable) { try { ((IDisposable)_Window).Dispose(); } catch (Exception) { Debug.Fail("Failed to dispose window"); } _Window = null; } // --- Reset the dialog subclass if (_Subclass != null) { _Subclass = null; } // --- Unhook dialog page properties HookProperties(false); } base.Dispose(disposing); }
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage.Dispose"]' /> /// <devdoc> /// Disposes this object. /// </devdoc> protected override void Dispose(bool disposing) { if (disposing) { if (_container != null) { try { _container.Dispose(); } catch (Exception) { Debug.Fail("Failed to dispose container"); } _container = null; } if (_window != null && _window is IDisposable) { try { ((IDisposable)_window).Dispose(); } catch (Exception) { Debug.Fail("Failed to dispose window"); } _window = null; } if (_subclass != null) { _subclass = null; } HookProperties(false); } base.Dispose(disposing); }