예제 #1
0
        public override void BuildChildNodes(ITreeBuilder treeBuilder, object dataObject)
        {
            var node = (DependenciesNode)dataObject;

            node.PackageDependencyCache.Refresh();

            var packagesNode = new PackageDependenciesNode(node);

            if (packagesNode.HasChildNodes())
            {
                treeBuilder.AddChild(packagesNode);
            }

            var sdkNode = new SdkDependenciesNode(node);

            treeBuilder.AddChild(sdkNode);

            var assembliesNode = new AssemblyDependenciesNode(node.Project);

            if (assembliesNode.HasChildNodes())
            {
                treeBuilder.AddChild(assembliesNode);
            }

            var projectsNode = new ProjectDependenciesNode(node.Project);

            if (projectsNode.HasChildNodes())
            {
                treeBuilder.AddChild(projectsNode);
            }
        }
예제 #2
0
        internal IEnumerable <object> GetChildNodes(TargetFrameworkNode frameworkNode)
        {
            bool addedFrameworkReferencesNode = false;

            if (frameworkNode != null)
            {
                var frameworkReferencesNode = new FrameworkReferencesNode(this);
                if (frameworkReferencesNode.HasChildNodes())
                {
                    addedFrameworkReferencesNode = true;
                    yield return(frameworkReferencesNode);
                }

                var packagesNode = new PackageDependenciesNode(frameworkNode);
                if (packagesNode.HasChildNodes())
                {
                    yield return(packagesNode);
                }

                if (!addedFrameworkReferencesNode)
                {
                    var sdkNode = new SdkDependenciesNode(frameworkNode);
                    if (sdkNode.HasChildNodes())
                    {
                        yield return(sdkNode);
                    }
                }
            }
            else
            {
                var frameworkReferencesNode = new FrameworkReferencesNode(this);
                if (frameworkReferencesNode.HasChildNodes())
                {
                    addedFrameworkReferencesNode = true;
                    yield return(frameworkReferencesNode);
                }

                var packagesNode = new PackageDependenciesNode(this);
                if (packagesNode.HasChildNodes())
                {
                    yield return(packagesNode);
                }

                if (!addedFrameworkReferencesNode)
                {
                    var sdkNode = new SdkDependenciesNode(this);
                    if (sdkNode.HasChildNodes())
                    {
                        yield return(sdkNode);
                    }
                }
            }

            var assembliesNode = new AssemblyDependenciesNode(Project);

            if (assembliesNode.HasChildNodes())
            {
                yield return(assembliesNode);
            }

            var projectsNode = new ProjectDependenciesNode(Project);

            if (projectsNode.HasChildNodes())
            {
                yield return(projectsNode);
            }
        }