private void OpeningContextMenu(object sender, CancelEventArgs args) { GotoAction ga = new GotoAction(); TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; this.cmGotoDefinition.Enabled = CodeCompletionActionsManager.CanGoTo(ta); this.cmGotoRealization.Enabled = CodeCompletionActionsManager.CanGoToRealization(ta); this.cmFindAllReferences.Enabled = CodeCompletionActionsManager.CanFindReferences(ta); this.cmGenerateRealization.Enabled = CodeCompletionActionsManager.CanGenerateRealization(ta); this.cmRename.Enabled = CodeCompletionActionsManager.CanGoTo(ta); }