Ejemplo n.º 1
0
        /// <summary>
        /// Create and retrive all unique enabled package sources
        /// </summary>
        /// <returns></returns>
        public IReadOnlyList <PackageSource> GetAllPackageSources()
        {
            var feeds = NuGetFeeds.Where(x => x.IsSelected);

            if (!feeds.Any())
            {
                //then try to return all feeds, 'all' feed probably is selected
                feeds = NuGetFeeds.Where(x => x.IsEnabled);
            }

            return(feeds.Select(x => new PackageSource(x.Source, x.Name, x.IsEnabled)).ToList());
        }
Ejemplo n.º 2
0
        protected override void OnPropertyChanged(AdvancedPropertyChangedEventArgs e)
        {
            if (string.Equals(e.PropertyName, nameof(ObservedFeed)))
            {
                if (e.NewValue is INuGetSource source)
                {
                    source.IsSelected = true;
                }

                if (e.OldValue is INuGetSource oldSelected)
                {
                    oldSelected.IsSelected = false;
                }
            }

            if (string.Equals(e.PropertyName, nameof(NuGetFeeds)))
            {
                ObservedFeed = NuGetFeeds.FirstOrDefault();
            }

            base.OnPropertyChanged(e);
        }
Ejemplo n.º 3
0
 public void Clear()
 {
     NuGetFeeds.Clear();
     ObservedFeed = null;
 }
Ejemplo n.º 4
0
 // Removes empty NuGet feeds.*
 private void CleanEmptyFeeds()
 {
     NuGetFeeds = NuGetFeeds?.Where(x => !IsNullOrEmpty(x.URL)).ToArray();
 }