public async Task Remove(ImageSourceId id)
        {
            _sources.Remove(id);
            await PersistAllSources();

            _sourceRemoves.OnNext(new SourceConfigurationRemovedEvent(id));
        }
        public async Task Change(ImageSourceId id, Func <IImageSourceConfiguration, IImageSourceConfiguration> updateConfiguration)
        {
            var originalSource = _sources[id];
            var updatedSource  = updateConfiguration(originalSource);

            _sources.Remove(id);
            _sources.Add(updatedSource);
            await PersistAllSources();

            _sourceChanges.OnNext(new SourceConfigurationChangedEvent(updatedSource));
        }
Exemple #3
0
 public ImageSourceConfiguration(ImageSourceId imageSourceId,
                                 ImageSourceName imageSourceName,
                                 ImageSourceType sourceType,
                                 IImageSourceSettings settings,
                                 TimeSpan updateInterval,
                                 bool isEnabled)
 {
     ImageSourceId   = imageSourceId;
     ImageSourceName = imageSourceName;
     SourceType      = sourceType;
     Settings        = settings;
     UpdateInterval  = updateInterval;
     IsEnabled       = isEnabled;
 }
 public SourceConfigurationRemovedEvent(ImageSourceId sourceId)
 {
     SourceId = sourceId;
 }
 public IImageSourceConfiguration Get(ImageSourceId id)
 {
     return(_sources[id]);
 }