This tree node simply shows no packages.
Inheritance: NuGet.Dialog.Providers.PackagesTreeNodeBase
Beispiel #1
0
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetEnabledPackageSourcesWithAggregate().ToList();

            // If there are exactly two package sources, it means one of them is the Aggregate.
            // In that case, remove the Aggregate source because it will be exactly the same as the main source.
            if (packageSources.Count == 2)
            {
                // Aggregate source is always the first one.
                Debug.Assert(packageSources[0].IsAggregate());
                packageSources.RemoveAt(0);
            }

            // create one tree node per package source
            foreach (var source in packageSources)
            {
                PackagesTreeNodeBase node;
                try
                {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception)
                {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }
        }
Beispiel #2
0
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetEnabledPackageSourcesWithAggregate();

            // create one tree node per package source
            foreach (var source in packageSources)
            {
                PackagesTreeNodeBase node;
                try
                {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception)
                {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }

            if (RootNode.Nodes.Count >= 2)
            {
                // Bug #628 : Do not set aggregate source as default because it
                // will slow down the dialog when querying two or more sources.
                RootNode.Nodes[1].IsSelected = true;
            }
        }
Beispiel #3
0
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetPackageSources();

            // create one tree node per package source
            foreach (var source in packageSources)
            {
                PackagesTreeNodeBase node = null;
                try {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception) {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }
        }
Beispiel #4
0
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetPackageSources();

            // create one tree node per package source
            foreach (var source in packageSources) {
                PackagesTreeNodeBase node = null;
                try {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception) {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }
        }
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetEnabledPackageSourcesWithAggregate().ToList();

            // If there are exactly two package sources, it means one of them is the Aggregate. 
            // In that case, remove the Aggregate source because it will be exactly the same as the main source.
            if (packageSources.Count == 2)
            {
                // Aggregate source is always the first one.
                Debug.Assert(packageSources[0].IsAggregate());
                packageSources.RemoveAt(0);
            }

            // create one tree node per package source
            foreach (var source in packageSources)
            {
                PackagesTreeNodeBase node;
                try
                {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception)
                {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }
        }
        protected override void FillRootNodes()
        {
            var packageSources = _packageSourceProvider.GetEnabledPackageSourcesWithAggregate();
           
            // create one tree node per package source
            foreach (var source in packageSources)
            {
                PackagesTreeNodeBase node;
                try
                {
                    var repository = new LazyRepository(_packageRepositoryFactory, source);
                    node = CreateTreeNodeForPackageSource(source, repository);
                }
                catch (Exception exception)
                {
                    // exception occurs if the Source value is invalid. In which case, adds an empty tree node in place.
                    node = new EmptyTreeNode(this, source.Name, RootNode);
                    ExceptionHelper.WriteToActivityLog(exception);
                }

                RootNode.Nodes.Add(node);
            }

            if (RootNode.Nodes.Count >= 2)
            {
                // Bug #628 : Do not set aggregate source as default because it 
                // will slow down the dialog when querying two or more sources.
                RootNode.Nodes[1].IsSelected = true;
            }
        }