Example #1
0
 protected override async Task CloseAsync()
 {
     ValidationTimer.Stop();
     Feeds.CollectionChanged -= OnFeedsCollectionChanged;
     ValidationTimer.Elapsed -= OnValidationTimerElapsed;
     Feeds.ForEach(f => UnsubscribeFromFeedPropertyChanged(f));
 }
Example #2
0
 void Load()
 {
     if (File.Exists(DataFile))
     {
         using (var reader = new StreamReader(DataFile))
         {
             Feeds = (ObservableCollection <Feed>)Serializer.Deserialize(reader);
         }
         Feeds.ForEach(f => f.Parent = this);
     }
 }
Example #3
0
        protected override void OnPropertyChanged(AdvancedPropertyChangedEventArgs e)
        {
            if (IsSaving)
            {
                return;
            }

            if (string.Equals(e.PropertyName, nameof(PackageSources)) && PackageSources is not null)
            {
                var storedPackageSources = PackageSources.OfType <NuGetFeed>().ToList();
                SettingsFeeds.AddRange(storedPackageSources);
                Feeds.AddRange(storedPackageSources);

                // Validate items on first initialization
                SupressFeedVerificationOnCollectionChanged = false;
                Feeds.ForEach(async x => await VerifyFeedAsync(x));
            }

            base.OnPropertyChanged(e);
        }