public bool IsEnabled(TextViewContext context) { if (context.SelectedTreeNodes == null) return false; foreach (var node in context.SelectedTreeNodes) { var typeNode = node as TypeTreeNode; if (typeNode != null && !typeNode.IsPublicAPI) return false; var eventNode = node as EventTreeNode; if (eventNode != null && (!eventNode.IsPublicAPI || !eventNode.EventDefinition.DeclaringType.IsPublic)) return false; var fieldNode = node as FieldTreeNode; if (fieldNode != null && (!fieldNode.IsPublicAPI || !fieldNode.FieldDefinition.DeclaringType.IsPublic)) return false; var propertyNode = node as PropertyTreeNode; if (propertyNode != null && (!propertyNode.IsPublicAPI || !propertyNode.PropertyDefinition.DeclaringType.IsPublic)) return false; var methodNode = node as MethodTreeNode; if (methodNode != null && (!methodNode.IsPublicAPI || !methodNode.MethodDefinition.DeclaringType.IsPublic)) return false; var namespaceNode = node as NamespaceTreeNode; if (namespaceNode != null && string.IsNullOrEmpty(namespaceNode.Name)) return false; } return true; }
static bool TreeView_IsVisible(TextViewContext context) { ModuleDef module; return context.TreeView == MainWindow.Instance.treeView && ((module = ILSpyTreeNode.GetModule(context.SelectedTreeNodes)) != null) && module.EntryPoint is MethodDef; }
public void Execute(TextViewContext context) { if (TreeView_IsVisible(context)) MainWindow.Instance.JumpToReference(ILSpyTreeNode.GetModule(context.SelectedTreeNodes).EntryPoint); else if (TextEditor_IsVisible(context)) MainWindow.Instance.JumpToReference(GetModule().EntryPoint); }
public bool IsVisible(TextViewContext context) { return context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length == 1 && context.SelectedTreeNodes[0] is AssemblyTreeNode && !string.IsNullOrWhiteSpace(((AssemblyTreeNode)context.SelectedTreeNodes[0]).LoadedAssembly.FileName); }
public void Execute(TextViewContext context) { if (TreeView_IsVisible(context)) MainWindow.Instance.JumpToReference(ILSpyTreeNode.GetModule(context.SelectedTreeNodes).GlobalType.FindStaticConstructor()); else if (TextEditor_IsVisible(context)) MainWindow.Instance.JumpToReference(GoToEntryPointCommand.GetModule().GlobalType.FindStaticConstructor()); }
static bool TextEditor_IsVisible(TextViewContext context) { ModuleDef module; return context.TextView != null && (module = GetModule()) != null && module.EntryPoint is MethodDef; }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (ILSpyTreeNode node in context.SelectedTreeNodes) { SearchMsdn(node); } } }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (var node in context.SelectedTreeNodes) { node.Parent.Children.Remove(node); } } }
public bool IsVisible(TextViewContext context) { if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) return false; if (context.SelectedTreeNodes == null) return context.Reference != null && context.Reference.Reference is MemberReference; return context.SelectedTreeNodes.All(n => n is IMemberTreeNode); }
public bool IsVisible(TextViewContext context) { var list = GetMappings(context); return list != null && list.Count != 0 && list[0].MemberMapping.MethodDefinition != null && list[0].MemberMapping.MethodDefinition.Body != null && list[0].MemberMapping.MethodDefinition.Body.Instructions.Count > 0; }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (IMemberTreeNode node in context.SelectedTreeNodes) { Analyze(node.Member); } } else if (context.Reference != null && context.Reference.Reference is IMemberRef) { if (context.Reference.Reference is IMemberRef) Analyze((IMemberRef)context.Reference.Reference); } }
public override void Execute(TextViewContext context) { var obj = GetReference(context); if (obj != null) { var member = MainWindow.ResolveReference(obj); if (member == null) MainWindow.Instance.ShowMessageBox("Could not resolve member definition"); else Execute(member); } }
public bool IsEnabled(TextViewContext context) { if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length > 0 && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) return false; if (context.SelectedTreeNodes == null) return context.Reference != null && MainWindow.ResolveReference(context.Reference.Reference) != null; foreach (IMemberTreeNode node in context.SelectedTreeNodes) { if (CanAnalyze(node.Member)) return true; } return false; }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (IMemberTreeNode node in context.SelectedTreeNodes) { Analyze(node.Member); } } else if (context.Reference != null && context.Reference.Reference is MemberReference) { if (context.Reference.Reference is MemberReference) Analyze((MemberReference)context.Reference.Reference); // TODO: implement support for other references: ParameterReference, etc. } }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (var node in context.SelectedTreeNodes) { var mr = node as IMemberTreeNode; if (mr != null) Analyze(mr.Member); } } else if (context.Reference != null && context.Reference.Reference is IMemberRef) { if (context.Reference.Reference is IMemberRef) Analyze((IMemberRef)context.Reference.Reference); } }
public void Execute(TextViewContext context) { if (context.TreeView != MainWindow.Instance.treeView) return; var asms = new List<LoadedAssembly>(); foreach (var node in context.SelectedTreeNodes) { var loadedAsm = GetLoadedAssembly(node); if (loadedAsm != null) asms.Add(loadedAsm); } if (asms.Count > 0) MainWindow.Instance.DisableMemoryMappedIO(asms); }
public bool IsVisible(TextViewContext context) { if (context.SelectedTreeNodes == null) return false; return context.SelectedTreeNodes.All( n => n is NamespaceTreeNode || n is TypeTreeNode || n is EventTreeNode || n is FieldTreeNode || n is PropertyTreeNode || n is MethodTreeNode); }
public void Execute(TextViewContext context) { // Known problem: explorer can't show files in the .NET 2.0 GAC. var asmNode = (AssemblyTreeNode)context.SelectedTreeNodes[0]; var filename = asmNode.LoadedAssembly.FileName; var args = string.Format("/select,{0}", filename); try { Process.Start(new ProcessStartInfo("explorer.exe", args)); } catch (IOException) { } catch (Win32Exception) { } }
public bool IsVisible(TextViewContext context) { if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) return false; if (context.SelectedTreeNodes == null) return context.Reference != null && context.Reference.Reference is MemberReference; var allMembersSelected = context.SelectedTreeNodes.All(n => n is IMemberTreeNode); if (context.TreeView is AnalyzerTreeView) { return allMembersSelected && context.SelectedTreeNodes.All(_ => _.Level > 1); } return allMembersSelected; }
public void Execute(TextViewContext 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)); }
public bool IsEnabled(TextViewContext context) { if (context.SelectedTreeNodes == null) return context.Reference != null && context.Reference.Reference is MemberReference; foreach (IMemberTreeNode node in context.SelectedTreeNodes) { if (!(node.Member is TypeDefinition || node.Member is FieldDefinition || node.Member is MethodDefinition || AnalyzedPropertyTreeNode.CanShow(node.Member) || AnalyzedEventTreeNode.CanShow(node.Member))) return false; } return true; }
public void Execute(TextViewContext context) { if (null == context.TextView) return; FoldingManager foldingManager = context.TextView.FoldingManager; if (null == foldingManager) return; bool doFold = true; foreach (FoldingSection fm in foldingManager.AllFoldings) { if (fm.IsFolded) { doFold = false; break; } } foreach (FoldingSection fm in foldingManager.AllFoldings) { fm.IsFolded = doFold; } }
public bool IsEnabled(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (var node in context.SelectedTreeNodes) { var mrNode = node as IMemberTreeNode; if (mrNode != null && !IsPublic(mrNode.Member)) return false; var namespaceNode = node as NamespaceTreeNode; if (namespaceNode != null && string.IsNullOrEmpty(namespaceNode.Name)) return false; } return true; } return context.Reference != null && context.Reference.Reference is IMemberRef; }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes != null) { foreach (var node in context.SelectedTreeNodes) { var nsNode = node as NamespaceTreeNode; if (nsNode != null) { SearchMsdn(string.Format(msdnAddress, nsNode.Name)); continue; } var mrNode = node as IMemberTreeNode; if (mrNode != null) { SearchMsdn(mrNode.Member); continue; } } } if (context.Reference != null) SearchMsdn(context.Reference.Reference as IMemberRef); }
public void Execute(TextViewContext context) { var textView = context.TextView; if (null == textView) return; var editor = textView.textEditor; FoldingManager foldingManager = context.TextView.FoldingManager; if (null == foldingManager) return; // TODO: or use Caret if position is not given? var posBox = context.Position; if (null == posBox) return; TextViewPosition pos = posBox.Value; // look for folding on this line: FoldingSection folding = foldingManager.GetNextFolding(editor.Document.GetOffset(pos.Line, 1)); if (folding == null || editor.Document.GetLineByOffset(folding.StartOffset).LineNumber != pos.Line) { // no folding found on current line: find innermost folding containing the mouse position folding = foldingManager.GetFoldingsContaining(editor.Document.GetOffset(pos.Line, pos.Column)).LastOrDefault(); } if (folding != null) { folding.IsFolded = !folding.IsFolded; } }
public bool IsVisible(TextViewContext context) { return(context.TextView != null); }
public bool IsVisible(TextViewContext context) { return(context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length > 0 && context.TreeView == MainWindow.Instance.treeView); }
public void Execute(TextViewContext context) { MainWindow.Instance.CloneActiveTab(); }
public void Execute(TextViewContext context) { MainWindow.Instance.OpenReferenceInNewTab(context.TextView, context.Reference); }
public bool IsVisible(TextViewContext context) { return(GetReference(context) != null); }
public bool IsEnabled(TextViewContext context) { return(MainWindow.Instance.IsDecompilerTabControl(context.TabControl) && IsEnabledInternal()); }
public void Execute(TextViewContext context) { DecompileNodes(GetNodes(context).ToArray()); }
public bool IsEnabled(TextViewContext context) { return true; }
public override void Execute(TextViewContext context) { PreserveNodeSelection(context, () => base.Execute(context)); }
public void Execute(TextViewContext context) { Execute(); }
public bool IsVisible(TextViewContext context) { return(CanExecute() && (context.SelectedTreeNodes != null || context.TextView != null)); }
public bool IsEnabled(TextViewContext context) { return(context.TextView != null && context.TextView.FoldingManager != null); }
public bool IsEnabled(TextViewContext context) { return(IsTypeNodeSelected(context)); }
public abstract void Execute(TextViewContext context);
public bool IsEnabled(TextViewContext context) => true;
public bool IsVisible(TextViewContext context) { return(OpenReferenceContextMenuEntry.GetReference(context) != null); }
public bool IsEnabled(TextViewContext context) { return(GetNodes(context).Any()); }
public void Initialize(TextViewContext context, MenuItem menuItem) { menuItem.InputGestureText = context.OpenedFromKeyboard ? "Ctrl+F12" : "Ctrl+Click"; }
public bool IsVisible(TextViewContext context) { return(context.SelectedTreeNodes != null || context.Reference?.Reference is IEntity); }
public bool IsVisible(TextViewContext context) { return(context.TextView != null && context.Reference != null); }
public bool IsVisible(TextViewContext context) { return(MainWindow.Instance.IsDecompilerTabControl(context.TabControl) && MainWindow.Instance.ActiveTabState != null); }
public void Execute(TextViewContext context) { MainWindow.Instance.OpenNewTab(); }
public void Execute(TextViewContext context) { MainWindow.Instance.CloseAllTabs(); }
public bool IsEnabled(TextViewContext context) { return(MainWindow.Instance.IsDecompilerTabControl(context.TabControl) && MainWindow.Instance.CloseAllButActiveTabCanExecute()); }
public void Initialize(TextViewContext context, MenuItem menuItem) { }
public bool IsVisible(TextViewContext context) { return (context == null || context.TextView != null) && DebuggerPlugin.DebugShowNextStatementCanExecute(); }
public virtual void Execute(TextViewContext context) { Execute(context, false); }
public bool IsEnabled(TextViewContext context) { return IsVisible(context); }
public bool IsVisible(TextViewContext context) { return(MainWindow.Instance.IsDecompilerTabControl(context.TabControl) && MainWindow.Instance.CloseAllTabsCanExecute()); }
public bool IsEnabled(TextViewContext context) { return(context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length == 1); }
public void Execute(TextViewContext context) { ExecuteInternal(); }
public bool IsEnabled(TextViewContext context) { return(true); }
public virtual bool IsVisible(TextViewContext context) { return(true); }
public bool IsVisible(TextViewContext context) { if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) return true; return false; }
public void Execute(TextViewContext context) { Execute(context.SelectedTreeNodes); }