• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ContextMenuEntryContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Execute

		public void Execute(ContextMenuEntryContext context)
		{
			if (context.SelectedTreeNodes == null)
				return;
			AssemblyTreeNode node = (AssemblyTreeNode)context.SelectedTreeNodes[0];
			var mod = node.LoadedAssembly.ModuleDefinition;
			if (mod != null) {
				SaveFileDialog dlg = new SaveFileDialog();
				dlg.FileName = node.LoadedAssembly.FileName;
				dlg.Filter = "Assembly|*.dll;*.exe";
				if (dlg.ShowDialog(MainWindow.Instance) == true) {
					mod.Write(dlg.FileName);
				}
			}
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:15,代码来源:ContextMenuCommand.cs


示例17: Execute

        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));
        }
开发者ID:4058665,项目名称:dnSpy,代码行数:15,代码来源:MethodBodyCommands.cs


示例18: IsVisible

		public bool IsVisible(ContextMenuEntryContext context) {
			return GetFile(context) != null;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:Commands.cs


示例19: IsEnabled

		public bool IsEnabled(ContextMenuEntryContext context) {
			return IsVisible(context);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:Commands.cs


示例20: Execute

		public void Execute(ContextMenuEntryContext context) {
			var file = GetFile(context);
			if (file != null)
				InMemoryModuleManager.Instance.UpdateModuleMemory(file);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:5,代码来源:Commands.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ContextMenuItemCollection类代码示例发布时间:2022-05-24
下一篇:
C# ContextMenu类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap