Beispiel #1
0
		void Execute(IList<MethodSourceStatement>? list) {
			if (list is null)
				return;

			var method = list[0].Method;
			if (StateMachineHelpers.TryGetKickoffMethod(method, out var containingMethod))
				method = containingMethod;
			var methodNode = appService.DocumentTreeView.FindNode(method);
			if (methodNode is null) {
				MsgBox.Instance.Show(string.Format(dnSpy_AsmEditor_Resources.Error_CouldNotFindMethod, method));
				return;
			}

			EditMethodBodyCodeCommand.Execute(editCodeVMCreator, addUpdatedNodesHelperProvider, undoCommandService, appService, new DocumentTreeNodeData[] { methodNode }, list);
		}
Beispiel #2
0
        void Execute(IList <MethodSourceStatement> list)
        {
            if (list == null)
            {
                return;
            }

            var method     = list[0].Method;
            var methodNode = appWindow.FileTreeView.FindNode(method);

            if (methodNode == null)
            {
                MsgBox.Instance.Show(string.Format(dnSpy_AsmEditor_Resources.Error_CouldNotFindMethod, method));
                return;
            }

            EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandManager, appWindow, new IFileTreeNodeData[] { methodNode }, BodyCommandUtils.GetInstructionOffsets(method, list));
        }
Beispiel #3
0
        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;
            }

            EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandService, appService, new DocumentTreeNodeData[] { methodNode }, list);
        }
Beispiel #4
0
 public override void Execute(AsmEditorContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, addUpdatedNodesHelperProvider, undoCommandService, appService, context.Nodes);
Beispiel #5
0
 public override bool IsVisible(AsmEditorContext context) => EditMethodBodyCodeCommand.CanExecute(editCodeVMCreator, context.Nodes);
Beispiel #6
0
 public override bool IsEnabled(CodeContext context) => !EditBodyCommand.IsVisibleInternal(editCodeVMCreator, context.MenuItemContextOrNull) && context.IsDefinition && EditMethodBodyCodeCommand.CanExecute(editCodeVMCreator, context.Nodes);
Beispiel #7
0
 public override void Execute(AsmEditorContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandManager, appWindow, context.Nodes);
Beispiel #8
0
 public override void Execute(CodeContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandService, appService, context.Nodes);