Beispiel #1
0
 static string GetHeader(IFileTreeNodeData[] nodes)
 {
     nodes = DeleteTypeDefCommand.FilterOutGlobalTypes(nodes);
     if (nodes.Length == 1)
     {
         return(string.Format(dnSpy_AsmEditor_Resources.DeleteX, UIUtilities.EscapeMenuItemHeader(nodes[0].ToString())));
     }
     return(string.Format(dnSpy_AsmEditor_Resources.DeleteTypesCommand, nodes.Length));
 }
Beispiel #2
0
 static void Initialize(ILSpyTreeNode[] nodes, MenuItem menuItem)
 {
     nodes = DeleteTypeDefCommand.FilterOutGlobalTypes(nodes);
     if (nodes.Length == 1)
     {
         menuItem.Header = string.Format("Delete {0}", UIUtils.EscapeMenuItemHeader(nodes[0].ToString()));
     }
     else
     {
         menuItem.Header = string.Format("Delete {0} types", nodes.Length);
     }
 }
Beispiel #3
0
 public override bool IsEnabled(CodeContext context) => context.IsDefinition && DeleteTypeDefCommand.CanExecute(context.Nodes);
Beispiel #4
0
 public override void Execute(AsmEditorContext context)
 {
     DeleteTypeDefCommand.Execute(undoCommandManager, context.Nodes);
 }
Beispiel #5
0
 public override string GetHeader(CodeContext context)
 {
     return(DeleteTypeDefCommand.GetHeader(context.Nodes));
 }
Beispiel #6
0
 public override bool IsEnabled(CodeContext context)
 {
     return(context.IsLocalTarget &&
            DeleteTypeDefCommand.CanExecute(context.Nodes));
 }
Beispiel #7
0
 void DeleteExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DeleteTypeDefCommand.Execute(MainWindow.Instance.SelectedNodes);
 }
Beispiel #8
0
 public override void Execute(AsmEditorContext context) => DeleteTypeDefCommand.Execute(undoCommandService, context.Nodes);
Beispiel #9
0
 protected override bool CanExecute(Context ctx)
 {
     return(ctx.ReferenceSegment.IsLocalTarget &&
            DeleteTypeDefCommand.CanExecute(ctx.Nodes));
 }
Beispiel #10
0
 protected override void Initialize(ILSpyTreeNode[] nodes, MenuItem menuItem)
 {
     DeleteTypeDefCommand.Initialize(nodes, menuItem);
 }
Beispiel #11
0
 protected override void ExecuteInternal(ILSpyTreeNode[] nodes)
 {
     DeleteTypeDefCommand.Execute(nodes);
 }
Beispiel #12
0
 protected override bool CanExecuteInternal(ILSpyTreeNode[] nodes)
 {
     return(DeleteTypeDefCommand.CanExecute(nodes));
 }
Beispiel #13
0
		CommandLoader(IWpfCommandManager wpfCommandManager, IFileTabManager fileTabManager, DeleteTypeDefCommand.EditMenuCommand removeCmd, DeleteTypeDefCommand.CodeCommand removeCmd2, TypeDefSettingsCommand.EditMenuCommand settingsCmd, TypeDefSettingsCommand.CodeCommand settingsCmd2) {
			wpfCommandManager.AddRemoveCommand(removeCmd);
			wpfCommandManager.AddRemoveCommand(removeCmd2, fileTabManager);
			wpfCommandManager.AddSettingsCommand(fileTabManager, settingsCmd, settingsCmd2);
		}
Beispiel #14
0
 public override void Execute(CodeContext context) => DeleteTypeDefCommand.Execute(undoCommandManager, context.Nodes);
Beispiel #15
0
 protected override void Execute(Context ctx)
 {
     DeleteTypeDefCommand.Execute(ctx.Nodes);
 }
Beispiel #16
0
 public override bool IsVisible(AsmEditorContext context) => DeleteTypeDefCommand.CanExecute(context.Nodes);
Beispiel #17
0
 protected override void Initialize(Context ctx, MenuItem menuItem)
 {
     DeleteTypeDefCommand.Initialize(ctx.Nodes, menuItem);
 }
Beispiel #18
0
 public override string GetHeader(AsmEditorContext context) => DeleteTypeDefCommand.GetHeader(context.Nodes);
Beispiel #19
0
 void DeleteCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = DeleteTypeDefCommand.CanExecute(MainWindow.Instance.SelectedNodes);
 }