当前位置: 首页>>代码示例>>C#>>正文


C# ContextMenuEntryContext类代码示例

本文整理汇总了C#中ContextMenuEntryContext的典型用法代码示例。如果您正苦于以下问题:C# ContextMenuEntryContext类的具体用法?C# ContextMenuEntryContext怎么用?C# ContextMenuEntryContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContextMenuEntryContext类属于命名空间,在下文中一共展示了ContextMenuEntryContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TextEditor_IsVisible

		static bool TextEditor_IsVisible(ContextMenuEntryContext context) {
			ModuleDef module;
			return context.Element is DecompilerTextView &&
				(module = GoToEntryPointCommand.GetModule()) != null &&
				module.GlobalType != null &&
				module.GlobalType.FindStaticConstructor() != null;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:7,代码来源:EntryPointCommands.cs

示例2: Initialize

 public override void Initialize(ContextMenuEntryContext context, MenuItem menuItem)
 {
     var tokRef = GetTokenReference(context);
     menuItem.Header = string.Format("Go to MD Table Row ({0:X8})", tokRef.Token);
     if (context.Element == MainWindow.Instance.treeView || context.Element is DecompilerTextView)
         menuItem.InputGestureText = "Shift+Alt+R";
 }
开发者ID:kenwilcox,项目名称:dnSpy,代码行数:7,代码来源:ContextMenuCommands.cs

示例3: TreeView_IsVisible

		static bool TreeView_IsVisible(ContextMenuEntryContext context) {
			ModuleDef module;
			return context.Element == MainWindow.Instance.treeView &&
				((module = ILSpyTreeNode.GetModule(context.SelectedTreeNodes)) != null) &&
				module.GlobalType != null &&
				module.GlobalType.FindStaticConstructor() != null;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:7,代码来源:EntryPointCommands.cs

示例4: Execute

		public void Execute(ContextMenuEntryContext context) {
			if (context.SelectedTreeNodes != null) {
				foreach (var node in context.SelectedTreeNodes) {
					node.Parent.Children.Remove(node);
				}
			}
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:RemoveAnalyzeContextMenuEntry.cs

示例5: GetTreeNode

		static ILSpyTreeNode GetTreeNode(ContextMenuEntryContext context) {
			if (context.Element is DecompilerTextView)
				return MainWindow.Instance.treeView.SelectedItem as ILSpyTreeNode;
			if (context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length != 0)
				return context.SelectedTreeNodes[0] as ILSpyTreeNode;
			return null;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:Commands.cs

示例6: IsVisible

		public bool IsVisible(ContextMenuEntryContext context) {
			if (context.SelectedTreeNodes != null)
				return context.SelectedTreeNodes.Length > 0 && context.SelectedTreeNodes.All(n => n is NamespaceTreeNode || n is IMemberTreeNode);

			if (context.Reference != null && context.Reference.Reference is IMemberRef)
				return IsPublic(context.Reference.Reference as IMemberRef);

			return false;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:SearchMsdnContextMenuEntry.cs

示例7: GetFile

		static MemoryModuleDefFile GetFile(ContextMenuEntryContext context) {
			var modNode = ILSpyTreeNode.GetNode<AssemblyTreeNode>(GetTreeNode(context));
			var mfile = modNode == null ? null : modNode.DnSpyFile as MemoryModuleDefFile;
			if (mfile == null)
				return null;
			if (mfile.Process.HasExited || mfile.Process.Debugger.ProcessState == DebuggerProcessState.Terminated)
				return null;
			return mfile;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:Commands.cs

示例8: IsVisible

		public bool IsVisible(ContextMenuEntryContext context) {
			if (!CanExecute())
				return false;
			if (context.Element is DecompilerTextView)
				return true;
			if (context.SelectedTreeNodes == null || context.SelectedTreeNodes.Length == 0)
				return false;
			var elem = context.SelectedTreeNodes[0];
			return elem is ILSpyTreeNode || elem is AnalyzerTreeNode;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:GoToTokenContextMenuEntry.cs

示例9: GetReference

		protected IMDTokenProvider GetReference(ContextMenuEntryContext context) {
			if (context.Reference != null)
				return context.Reference.Reference as IMDTokenProvider;
			if (context.SelectedTreeNodes != null && context.SelectedTreeNodes.Length != 0 &&
					context.SelectedTreeNodes[0] is ITokenTreeNode) {
				return ((ITokenTreeNode)context.SelectedTreeNodes[0]).MDTokenProvider;
			}

			return null;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:10,代码来源:CopyTokenContextMenuEntry.cs

示例10: Execute

		public override void Execute(ContextMenuEntryContext 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);
			}
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:10,代码来源:CopyTokenContextMenuEntry.cs

示例11: Execute

		public void Execute(ContextMenuEntryContext context) {
			if (context.Element != MainWindow.Instance.treeView)
				return;
			var asms = new List<DnSpyFile>();
			foreach (var node in context.SelectedTreeNodes) {
				var file = GetDnSpyFile(node);
				if (file != null)
					asms.Add(file);
			}
			if (asms.Count > 0)
				MainWindow.Instance.DisableMemoryMappedIO(asms);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:12,代码来源:AssemblyCommands.cs

示例12: IsEnabled

		public bool IsEnabled(ContextMenuEntryContext context) {
			if (context.Element 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 (var node in context.SelectedTreeNodes) {
				var mr = node as IMemberTreeNode;
				if (mr != null && CanAnalyze(mr.Member))
					return true;
			}
			return false;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:12,代码来源:AnalyzeContextMenuEntry.cs

示例13: Execute

		public void Execute(ContextMenuEntryContext context) {
			if (context.Element != 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);
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:12,代码来源:AssemblyCommands.cs

示例14: Execute

		public void Execute(ContextMenuEntryContext 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) {
			}
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:13,代码来源:OpenContainingFolderContextMenuEntry.cs

示例15: Execute

 public void Execute(ContextMenuEntryContext 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);
     }
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:13,代码来源:AnalyzeContextMenuEntry.cs


注:本文中的ContextMenuEntryContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。