예제 #1
0
        public static ILSpyTreeNode Create(string key, object data)
        {
            ILSpyTreeNode result = null;

            foreach (var factory in App.ExportProvider.GetExportedValues <IResourceNodeFactory>())
            {
                result = factory.CreateNode(key, data);
                if (result != null)
                {
                    return(result);
                }
            }
            var streamData = data as Stream;

            if (streamData != null)
            {
                result = new ResourceEntryNode(key, data as Stream);
            }

            return(result);
        }
예제 #2
0
        void ApplyFilterToChild(ILSpyTreeNode child)
        {
            FilterResult r;

            if (this.FilterSettings == null)
            {
                r = FilterResult.Match;
            }
            else
            {
                r = child.Filter(this.FilterSettings);
            }
            switch (r)
            {
            case FilterResult.Hidden:
                child.IsHidden = true;
                break;

            case FilterResult.Match:
                child.FilterSettings = StripSearchTerm(this.FilterSettings);
                child.IsHidden       = false;
                break;

            case FilterResult.Recurse:
                child.FilterSettings = this.FilterSettings;
                child.EnsureChildrenFiltered();
                child.IsHidden = child.Children.All(c => c.IsHidden);
                break;

            case FilterResult.MatchAndRecurse:
                child.FilterSettings = StripSearchTerm(this.FilterSettings);
                child.EnsureChildrenFiltered();
                child.IsHidden = child.Children.All(c => c.IsHidden);
                break;

            default:
                throw new InvalidEnumArgumentException();
            }
        }