mirror of https://github.com/icsharpcode/ILSpy.git
11 changed files with 88 additions and 8 deletions
Before Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 575 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 788 B |
@ -0,0 +1,72 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Mono.Cecil; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ResourcesTreeNode.
|
||||||
|
/// </summary>
|
||||||
|
class ResourceListTreeNode : ILSpyTreeNode<ResourceTreeNode> |
||||||
|
{ |
||||||
|
readonly ModuleDefinition module; |
||||||
|
|
||||||
|
public ResourceListTreeNode(ModuleDefinition module) |
||||||
|
{ |
||||||
|
this.LazyLoading = true; |
||||||
|
this.module = module; |
||||||
|
} |
||||||
|
|
||||||
|
public override object Text { |
||||||
|
get { return "Resources"; } |
||||||
|
} |
||||||
|
|
||||||
|
public override object Icon { |
||||||
|
get { return Images.Resource; } |
||||||
|
} |
||||||
|
|
||||||
|
protected override void LoadChildren() |
||||||
|
{ |
||||||
|
foreach (Resource r in module.Resources) |
||||||
|
this.Children.Add(new ResourceTreeNode(r)); |
||||||
|
} |
||||||
|
|
||||||
|
public override FilterResult Filter(FilterSettings settings) |
||||||
|
{ |
||||||
|
if (string.IsNullOrEmpty(settings.SearchTerm)) |
||||||
|
return FilterResult.Match; |
||||||
|
else |
||||||
|
return FilterResult.Recurse; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class ResourceTreeNode : ILSpyTreeNode |
||||||
|
{ |
||||||
|
Resource r; |
||||||
|
|
||||||
|
public ResourceTreeNode(Resource r) |
||||||
|
{ |
||||||
|
this.r = r; |
||||||
|
} |
||||||
|
|
||||||
|
public override object Text { |
||||||
|
get { return r.Name; } |
||||||
|
} |
||||||
|
|
||||||
|
public override object Icon { |
||||||
|
get { return Images.Resource; } |
||||||
|
} |
||||||
|
|
||||||
|
public override FilterResult Filter(FilterSettings settings) |
||||||
|
{ |
||||||
|
if (!settings.ShowInternalApi && (r.Attributes & ManifestResourceAttributes.VisibilityMask) == ManifestResourceAttributes.Private) |
||||||
|
return FilterResult.Hidden; |
||||||
|
if (settings.SearchTermMatches(r.Name)) |
||||||
|
return FilterResult.Match; |
||||||
|
else |
||||||
|
return FilterResult.Hidden; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue