예제 #1
0
 static AssemblyTreeNode GetAssemblyTreeNode(ContextMenuEntryContext context)
 {
     if (ShowAddressReferenceInHexEditorCommand.IsVisibleInternal(context))
     {
         return(null);
     }
     if (ShowILRangeInHexEditorCommand.IsVisibleInternal(context))
     {
         return(null);
     }
     if (ShowHexNodeInHexEditorCommand.IsVisibleInternal(context))
     {
         return(null);
     }
     if (context.Element is DecompilerTextView)
     {
         return(GetActiveAssemblyTreeNode());
     }
     if (context.Element == MainWindow.Instance.treeView)
     {
         return(context.SelectedTreeNodes != null &&
                context.SelectedTreeNodes.Length == 1 ?
                context.SelectedTreeNodes[0] as AssemblyTreeNode : null);
     }
     return(null);
 }
예제 #2
0
        static bool CanExecuteCommand()
        {
            var context = CreateContext();

            return(ShowAddressReferenceInHexEditorCommand.IsVisibleInternal(context) ||
                   ShowILRangeInHexEditorCommand.IsVisibleInternal(context) ||
                   ShowHexNodeInHexEditorCommand.IsVisibleInternal(context) ||
                   IsVisibleInternal(context));
        }
예제 #3
0
        static void ExecuteCommand()
        {
            var context = CreateContext();

            if (ShowAddressReferenceInHexEditorCommand.IsVisibleInternal(context))
            {
                ShowAddressReferenceInHexEditorCommand.ExecuteInternal(context);
            }
            else if (ShowILRangeInHexEditorCommand.IsVisibleInternal(context))
            {
                ShowILRangeInHexEditorCommand.ExecuteInternal(context);
            }
            else if (ShowHexNodeInHexEditorCommand.IsVisibleInternal(context))
            {
                ShowHexNodeInHexEditorCommand.ExecuteInternal(context);
            }
            else if (IsVisibleInternal(context))
            {
                ExecuteInternal(context);
            }
        }