コード例 #1
0
 public WeatherViewModel(WeatherQueryResponse weatherData, IViewFacade viewFacade, WeatherCodeService weatherCodeService, WeatherRecommendationService evaluationService)
 {
     WeatherData           = weatherData;
     ViewFacade            = viewFacade;
     WeatherCodeService    = weatherCodeService;
     RecommendationService = evaluationService;
 }
コード例 #2
0
 /// <summary>
 /// Creates an instance of the <see cref="MainViewModel"/>
 /// </summary>
 public MainViewModel(IViewFacade viewFacade, WeatherStackService weatherService,
                      Func <WeatherQueryResponse, WeatherViewModel> weatherViewModelFactory,
                      Func <string, ErrorViewModel> errorViewModelFactory)
 {
     ViewFacade                   = viewFacade;
     this.WeatherService          = weatherService;
     this.WeatherViewModelFactory = weatherViewModelFactory;
     ErrorViewModelFactory        = errorViewModelFactory;
 }
コード例 #3
0
        public WebAppService(WebAppSettings settings)
        {
            var viewStore            = new CosmosStore(settings.CosmosEndpoint, settings.CosmosAuthKey, settings.DatabaseId, settings.ViewCollectionId);
            var stationDetailHandler = new StationDetailHandler(viewStore);
            var stationListHandler   = new StationListHandler(viewStore);

            var publisher = new LocalPublisher();

            publisher.RegisterHandler <StationCreated>(stationDetailHandler.Handle);
            publisher.RegisterHandler <StationRenamed>(stationListHandler.Handle);

            var stationRepository      = new CosmosEventRepository <Station>(settings.CosmosEndpoint, settings.CosmosAuthKey, settings.DatabaseId, settings.EventCollectionId, publisher);
            var stationCommandHandlers = new StationHandlers(stationRepository);

            var bus = new LocalBus();

            bus.RegisterHandler <CreateStation>(stationCommandHandlers.Handle);
            bus.RegisterHandler <RenameStation>(stationCommandHandlers.Handle);

            Bus        = bus;
            Publisher  = publisher;
            ViewFacade = new ViewFacade(viewStore);
        }
コード例 #4
0
 public FileBrowserViewModel(IViewFacade viewFacade, FileSelectionMode mode, FileInfo?preselectedFile = null)
 {
     ViewFacade           = viewFacade;
     this.Mode            = mode;
     this.PreSelectedFile = preselectedFile;
 }