Beispiel #1
0
        void Execute(IList <SourceCodeMapping> list)
        {
            if (list == null)
            {
                return;
            }

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

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

            MethodBodySettingsCommand.Execute(methodAnnotations, undoCommandManager, appWindow, new IFileTreeNodeData[] { methodNode }, GetInstructionOffsets(method, list));
        }
Beispiel #2
0
        public void Execute(ContextMenuEntryContext context)
        {
            var list = GetMappings(context);

            if (list == null)
            {
                return;
            }

            var method     = list[0].MemberMapping.MethodDefinition;
            var methodNode = MainWindow.Instance.AssemblyListTreeNode.FindMethodNode(method);

            if (methodNode == null)
            {
                MainWindow.Instance.ShowMessageBox(string.Format("Could not find method: {0}", method));
                return;
            }

            MethodBodySettingsCommand.Execute(new ILSpyTreeNode[] { methodNode }, GetInstructionOffsets(method, list));
        }
Beispiel #3
0
 protected override void Execute(Context ctx)
 {
     MethodBodySettingsCommand.Execute(ctx.Nodes);
 }
Beispiel #4
0
 protected override bool CanExecute(Context ctx)
 {
     return(ctx.ReferenceSegment.IsLocalTarget &&
            MethodBodySettingsCommand.CanExecute(ctx.Nodes));
 }
Beispiel #5
0
 protected override void ExecuteInternal(ILSpyTreeNode[] nodes)
 {
     MethodBodySettingsCommand.Execute(nodes);
 }
Beispiel #6
0
 protected override bool CanExecuteInternal(ILSpyTreeNode[] nodes)
 {
     return(MethodBodySettingsCommand.CanExecute(nodes));
 }
Beispiel #7
0
 public override void Execute(AsmEditorContext context)
 {
     MethodBodySettingsCommand.Execute(methodAnnotations, undoCommandManager, appWindow, context.Nodes);
 }
Beispiel #8
0
 public override bool IsVisible(AsmEditorContext context)
 {
     return(MethodBodySettingsCommand.CanExecute(context.Nodes));
 }
Beispiel #9
0
 public override bool IsEnabled(CodeContext context)
 {
     return(context.IsLocalTarget &&
            MethodBodySettingsCommand.CanExecute(context.Nodes));
 }