int IVsHierarchy.Close() { _hierarchyClosed = true; this.Close(); if (cookie != 0) { // Unsubscribe to events IVsTrackProjectDocuments2 trackDocuments = GetTrackProjectDocuments(); trackDocuments.UnadviseTrackProjectDocumentsEvents(cookie); cookie = 0; } if (this._menuService != null) { OleMenuCommandService tempService = this._menuService; this._menuService = null; tempService.Dispose(); } if (_inExecCommand == 0) { FreeInterfaces(); } return(VSConstants.S_OK); }
/// <summary> /// Performs the clean-up operations for this object. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { // Close the text view. if (null != textView) { // Remove the command filter. textView.RemoveCommandFilter(this); // Release the text view. textView.CloseView(); textView = null; } // Dispose the command service. if (null != commandService) { commandService.Dispose(); commandService = null; } } } finally { base.Dispose(disposing); } }
protected override void Close() { if (_menuService != null) { foreach (var command in _commands) { _menuService.RemoveCommand(command); } _menuService.Dispose(); } _commands.Clear(); base.Close(); }
public virtual void FreeInterfaces() { if (this._menuService != null) { OleMenuCommandService tempService = this._menuService; this._menuService = null; tempService.Dispose(); } _innerOleCommandTarget = null; _innerVsAggregatableProject = null; _innerVsUIHierarchy = null; _innerVsHierarchy = null; }