Example #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);
		}
Example #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));
        }
Example #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);
        }
Example #4
0
 public override void Execute(AsmEditorContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, addUpdatedNodesHelperProvider, undoCommandService, appService, context.Nodes);
Example #5
0
 public override void Execute(AsmEditorContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandManager, appWindow, context.Nodes);
Example #6
0
 public override void Execute(CodeContext context) => EditMethodBodyCodeCommand.Execute(editCodeVMCreator, methodAnnotations, undoCommandService, appService, context.Nodes);