IList <MethodSourceStatement> GetStatements() { var documentViewer = appWindow.FileTabManager.ActiveTab.TryGetDocumentViewer(); if (documentViewer == null) { return(null); } if (!documentViewer.UIObject.IsKeyboardFocusWithin) { return(null); } return(BodyCommandUtils.GetStatements(documentViewer, documentViewer.Caret.Position.BufferPosition)); }
IList <MethodSourceStatement> GetStatements() { var documentViewer = appService.DocumentTabService.ActiveTab.TryGetDocumentViewer(); if (documentViewer == null) { return(null); } if (!documentViewer.UIObject.IsKeyboardFocusWithin) { return(null); } return(BodyCommandUtils.GetStatements(documentViewer, documentViewer.Caret.Position.BufferPosition, FindByTextPositionOptions.None)); }
internal static bool IsVisibleInternal(IMenuItemContext?context) => IsVisible(BodyCommandUtils.GetStatements(context, FindByTextPositionOptions.None));
void Execute(IList <MethodSourceStatement> list) { if (list == null) { return; } var method = list[0].Method; var methodNode = appService.DocumentTreeView.FindNode(method); if (methodNode == null) { MsgBox.Instance.Show(string.Format(dnSpy_AsmEditor_Resources.Error_CouldNotFindMethod, method)); return; } EditMethodBodyILCommand.Execute(methodAnnotations, undoCommandService, appService, new DocumentTreeNodeData[] { methodNode }, BodyCommandUtils.GetInstructionOffsets(method, list)); }
public override void Execute(IMenuItemContext context) => Execute(BodyCommandUtils.GetStatements(context, FindByTextPositionOptions.None));
public override void Execute(IMenuItemContext context) => Execute(BodyCommandUtils.GetStatements(context));
internal static bool IsVisibleInternal(IMenuItemContext context) => IsVisible(BodyCommandUtils.GetStatements(context));