public async Task Add(IImageSourceConfiguration source) { _sources.Add(source); await PersistAllSources(); _sourceAdds.OnNext(new SourceConfigurationAddedEvent(source)); }
public SImageSource ToSerializationModel(IImageSourceConfiguration imageSource) { return(new SImageSource(imageSource.ImageSourceId.Value, imageSource.ImageSourceName.Value, imageSource.SourceType.Value, imageSource.UpdateInterval, imageSource.IsEnabled)); }
public SourcesModule(IImageSourceConfigurations sourceConfigurations, IImageSourceConfigurationFactory sourceConfigurationFactory) : base("/sources") { Get["/"] = _ => sourceConfigurations.Select(s => new ImageSourceViewModel(s.ImageSourceId.Value, s.SourceType.Value)); Post["/add", true] = async(parameters, ctx) => { var request = this.Bind <AddRequestModel>(); IImageSourceConfiguration source = sourceConfigurationFactory.CreateNewSource(new ImageSourceType(request.SourceType)); await sourceConfigurations.Add(source); return(source.ImageSourceId); }; }
public SourceConfigurationChangedEvent(IImageSourceConfiguration updatedSourceConfiguration) { UpdatedSourceConfiguration = updatedSourceConfiguration; }
public SourceConfigurationAddedEvent(IImageSourceConfiguration sourceConfiguration) { SourceConfiguration = sourceConfiguration; }
public ImageSource(IImageSourceConfiguration configuration, IImageSourcePluginFactory imageSourcePluginFactory) { _configuration = configuration; _imageSourcePluginFactory = imageSourcePluginFactory; }
public IImageSource CreateImageSource(IImageSourceConfiguration imageSourceConfiguration) { return(new ImageSource(imageSourceConfiguration, _imageSourcePluginFactory)); }