本文整理汇总了C#中TextViewContext类的典型用法代码示例。如果您正苦于以下问题:C# TextViewContext类的具体用法?C# TextViewContext怎么用?C# TextViewContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextViewContext类属于命名空间,在下文中一共展示了TextViewContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IsVisible
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);
}
开发者ID:gsong2014,项目名称:dnSpy,代码行数:7,代码来源:OpenContainingFolderContextMenuEntry.cs
示例2: Execute
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());
}
开发者ID:gsong2014,项目名称:dnSpy,代码行数:7,代码来源:EntryPointCommands.cs
示例3: TextEditor_IsVisible
static bool TextEditor_IsVisible(TextViewContext context)
{
ModuleDef module;
return context.TextView != null &&
(module = GetModule()) != null &&
module.EntryPoint is MethodDef;
}
开发者ID:gsong2014,项目名称:dnSpy,代码行数:7,代码来源:EntryPointCommands.cs
示例4: TreeView_IsVisible
static bool TreeView_IsVisible(TextViewContext context)
{
ModuleDef module;
return context.TreeView == MainWindow.Instance.treeView &&
((module = ILSpyTreeNode.GetModule(context.SelectedTreeNodes)) != null) &&
module.EntryPoint is MethodDef;
}
开发者ID:gsong2014,项目名称:dnSpy,代码行数:7,代码来源:EntryPointCommands.cs
示例5: IsEnabled
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;
}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:34,代码来源:SearchMsdnContextMenuEntry.cs
示例6: Execute
public void Execute(TextViewContext context)
{
if (context.SelectedTreeNodes != null) {
foreach (var node in context.SelectedTreeNodes) {
node.Parent.Children.Remove(node);
}
}
}
开发者ID:Zvirja,项目名称:ILSpy,代码行数:8,代码来源:RemoveAnalyzeContextMenuEntry.cs
示例7: IsVisible
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);
}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:8,代码来源:AnalyzeContextMenuEntry.cs
示例8: Execute
public void Execute(TextViewContext context)
{
if (context.SelectedTreeNodes != null) {
foreach (ILSpyTreeNode node in context.SelectedTreeNodes) {
SearchMsdn(node);
}
}
}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:8,代码来源:SearchMsdnContextMenuEntry.cs
示例9: IsVisible
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;
}
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:9,代码来源:MethodBodyCommands.cs
示例10: Execute
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);
}
}
开发者ID:cynecx,项目名称:dnSpy,代码行数:11,代码来源:AnalyzeContextMenuEntry.cs
示例11: Execute
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);
}
}
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:11,代码来源:CopyTokenContextMenuEntry.cs
示例12: Execute
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.
}
}
开发者ID:Zvirja,项目名称:ILSpy,代码行数:12,代码来源:AnalyzeContextMenuEntry.cs
示例13: IsEnabled
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;
}
开发者ID:cynecx,项目名称:dnSpy,代码行数:12,代码来源:AnalyzeContextMenuEntry.cs
示例14: Execute
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);
}
}
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:13,代码来源:AnalyzeContextMenuEntry.cs
示例15: IsVisible
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);
}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:13,代码来源:SearchMsdnContextMenuEntry.cs
示例16: Execute
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);
}
开发者ID:cynecx,项目名称:dnSpy,代码行数:13,代码来源:AssemblyCommands.cs
示例17: Execute
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) {
}
}
开发者ID:gsong2014,项目名称:dnSpy,代码行数:14,代码来源:OpenContainingFolderContextMenuEntry.cs
示例18: IsVisible
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;
}
开发者ID:x-strong,项目名称:ILSpy,代码行数:14,代码来源:AnalyzeContextMenuEntry.cs
示例19: Execute
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));
}
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:15,代码来源:MethodBodyCommands.cs
示例20: IsEnabled
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;
}
开发者ID:Zvirja,项目名称:ILSpy,代码行数:15,代码来源:AnalyzeContextMenuEntry.cs
注:本文中的TextViewContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论