Skip to content

Commit

Permalink
codepane context menu teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed Jun 2, 2015
1 parent d8091a0 commit 78d4b51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
9 changes: 0 additions & 9 deletions RetailCoder.VBE/UI/CodeInspections/CodeInspectionsToolbar.cs
Expand Up @@ -233,15 +233,6 @@ private void SetQuickFixTooltip()

public void Dispose()
{
Dispose(true);
}

protected virtual void Dispose(bool disposing)
{
_refreshButton.Click -= _refreshButton_Click;
_quickFixButton.Click -= _quickFixButton_Click;
_navigatePreviousButton.Click -= _navigatePreviousButton_Click;
_navigateNextButton.Click -= _navigateNextButton_Click;
}
}
}
17 changes: 15 additions & 2 deletions RetailCoder.VBE/UI/RefactorMenu.cs
Expand Up @@ -94,6 +94,19 @@ private void InitializeRefactorContextMenu()
InitializeFindSymbolContextMenu();
}

private void RemoveRefactorContextMenu()
{
_extractMethodContextButton.Delete();
_renameContextButton.Delete();
_reorderParametersContextButton.Delete();
_removeParametersContextButton.Delete();
_refactorCodePaneContextMenu.Delete();

_findAllReferencesContextMenu.Delete();
_findAllImplementationsContextMenu.Delete();
_findSymbolContextMenu.Delete();
}

private CommandBarButton _findAllReferencesContextMenu;
private void InitializeFindReferencesContextMenu()
{
Expand Down Expand Up @@ -511,10 +524,10 @@ protected override void Dispose(bool disposing)
_findAllImplementationsContextMenu.Click -= FindAllImplementationsContextMenu_Click;
_findSymbolContextMenu.Click -= FindSymbolContextMenuClick;

_menuControls.Parent.FindControl(_menu.Type, _menu.Id, _menu.Tag, _menu.Visible);
RemoveRefactorContextMenu();

_disposed = true;
base.Dispose(disposing);
base.Dispose(true);
}
}
}

0 comments on commit 78d4b51

Please sign in to comment.