예제 #1
0
 private void DownloadEntry_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(DownloadEntryWithConfiguration.DownloadLinkIsVisited))
     {
         var obj = (DownloadEntryWithConfiguration)sender;
         var downloadEntryConfig = new DownloadEntryConfiguration
         {
             Id = obj.DownloadEntryId,
             DownloadLinkIdentifier = obj.DownloadLinkIdentifier,
             Title         = obj.DownloadEntryTitleShort,
             IsLinkVisited = obj.DownloadLinkIsVisited
         };
         _configurationLogic.SaveDownloadEntryConfiguration(downloadEntryConfig);
         obj.DownloadEntryId = downloadEntryConfig.Id;
     }
 }
 public void SaveDownloadEntryConfiguration(DownloadEntryConfiguration config)
 {
     _repository.Save(config);
 }
예제 #3
0
        private bool TryGettingPersistedConfigurationEntry(IReadOnlyCollection <DownloadEntryConfiguration> persistedConfigurationEntries, DownloadEntry downloadEntry, out DownloadEntryConfiguration configEntry)
        {
            // We pririorize the LinkIdentifier, but use the ShortTitle for the backword-compatibility
            configEntry = persistedConfigurationEntries.FirstOrDefault(f => f.DownloadLinkIdentifier == downloadEntry.DownloadLinkIdentifier);
            if (configEntry == null)
            {
                configEntry = persistedConfigurationEntries.FirstOrDefault(f => f.Title == downloadEntry.DownloadEntryTitleShort);
            }

            return(configEntry != null);
        }