Esempio n. 1
0
        public override IEnumerable <TreeNodeViewModel> VisitNodeAndBuildChildren(GraphNodeViewModel graph, bool expandChildren, CancellationToken cancellation)
        {
            foreach (GraphMemberType graphMemberType in GetGraphMemberTypesInOrder())
            {
                cancellation.ThrowIfCancellationRequested();
                GraphMemberCategoryNodeViewModel graphMemberCategory = CreateCategory(graph, graphMemberType, expandChildren);

                if (graphMemberCategory != null)
                {
                    yield return(graphMemberCategory);
                }
            }
        }
        public override IEnumerable <TreeNodeViewModel> VisitNode(GraphNodeViewModel graph)
        {
            foreach (GraphMemberType graphMemberType in GetGraphMemberTypesInOrder())
            {
                Cancellation.ThrowIfCancellationRequested();
                GraphMemberCategoryNodeViewModel graphMemberCategory = CreateCategory(graph, graphMemberType);

                if (graphMemberCategory != null)
                {
                    yield return(graphMemberCategory);
                }
            }
        }
Esempio n. 3
0
        protected virtual IEnumerable <TreeNodeViewModel> CreateGraphCategoryChildren <TSymbolInfo>(GraphMemberCategoryNodeViewModel graphMemberCategory,
                                                                                                    bool isExpanded, Func <TSymbolInfo, TreeNodeViewModel> constructor,
                                                                                                    CancellationToken cancellation)
            where TSymbolInfo : SymbolItem
        {
            IEnumerable <SymbolItem> categoryTreeNodes = graphMemberCategory.CheckIfNull(nameof(graphMemberCategory))
                                                         .GetCategoryGraphNodeSymbols();

            if (categoryTreeNodes.IsNullOrEmpty())
            {
                return(Enumerable.Empty <TreeNodeViewModel>());
            }

            cancellation.ThrowIfCancellationRequested();
            var graphSemanticModel    = graphMemberCategory.GraphSemanticModel;
            var graphMemberViewModels = from graphMemberInfo in categoryTreeNodes.OfType <TSymbolInfo>()
                                        where graphMemberInfo.SymbolBase.ContainingType == graphSemanticModel.Symbol ||
                                        graphMemberInfo.SymbolBase.ContainingType.OriginalDefinition == graphSemanticModel.Symbol.OriginalDefinition
                                        orderby graphMemberInfo.SymbolBase.Name
                                        select constructor(graphMemberInfo);

            return(graphMemberViewModels);
        }