Example #1
0
 public ForecastController(IWeatherService weatherService, IForecastProvider forecastProvider,
                           IForecastConverter forecastConverter)
 {
     _weatherService    = weatherService;
     _forecastProvider  = forecastProvider;
     _forecastConverter = forecastConverter;
 }
Example #2
0
 public ChatBotDialog(LuisServiceFactory luisServiceFactory, ILuisSubscriptionResolutionService luisSubscriptionResolutionService,
                      ILuisServiceCreator luisServiceCreator, IWeatherService weatherService)
     : base(typeof(ChatBotDialog), luisServiceFactory, luisSubscriptionResolutionService, luisServiceCreator)
 {
     dialogType      = DialogType.weather;
     _weatherService = weatherService;
 }
Example #3
0
        public ForecastDetailModel(IWeatherService weatherService, ITextToSpeechService textToSpeechService)
        {
            _weatherService      = weatherService;
            _textToSpeechService = textToSpeechService;

            InitData();
        }
Example #4
0
 public WeatherForecastController(
     ILogger <WeatherForecastController> logger,
     IWeatherService weatherService)
 {
     _logger         = logger;
     _weatherService = weatherService;
 }
Example #5
0
 public WeatherLogic(IWeatherService weatherService)
 {
     _weatherService            = weatherService;
     baseInfoResponse           = new RootObject();
     weatherStationInfoResponse = new List <TempRootObject>();
     percipitationResponse      = new PercepRootObject();
 }
Example #6
0
        public void GetCityWeather_WithMatchingResults_ReturnsResults(
            [Frozen] ICityRepository cityRepository,
            [Frozen] IWeatherService weatherService,
            CityWeatherSearchService sut,
            City city,
            IEnumerable <Weather> weather,
            string cityName)
        {
            //Arrange
            cityRepository.GetCity(Arg.Is <string>(m => m == cityName))
            .Returns(city);

            weatherService.GetHourlyWeather(Arg.Is <Guid>(m => m == city.Id))
            .Returns(weather);

            // Act
            var cityWeather = sut.GetCityWeather(cityName);

            // Assert
            cityRepository.Received(1).GetCity(Arg.Is <string>(m => m == cityName));
            weatherService.Received(1).GetHourlyWeather(Arg.Is <Guid>(m => m == city.Id));

            cityWeather.City.Should().Be(city);
            cityWeather.HourlyWeather.Should().BeSameAs(weather);
        }
        public void ConstructorSetsRestClientUrl()
        {
            var restClient = new RestClient();

            _weatherService = new BbcWeatherService(restClient, ApiUrl);
            restClient.BaseUrl.ShouldBeEquivalentTo(new Uri(ApiUrl));
        }
Example #8
0
 public App(IClock clock, IClient client, IWeatherService weatherService, string stationId)
 {
     this.clock          = clock;
     this.client         = client;
     this.stationId      = stationId;
     this.weatherService = weatherService;
 }
Example #9
0
        static Functions()
        {
            var ctx = new WeatherForecastContext();

            _repo       = new WeatherForecastRepository(ctx);
            _weatherSvc = new AccuweatherWeatherSerivce(CloudConfigurationManager.GetSetting("AccuweatherWeatherService:ApiKey"));
        }
Example #10
0
 private static void RegisterServices()
 {
     _emailService          = UnityContainerFactory.GetContainer().Resolve <IEmailService>();
     _sportsService         = UnityContainerFactory.GetContainer().Resolve <ISportsService>();
     _transportationService = UnityContainerFactory.GetContainer().Resolve <ITransportationService>();
     _weatherService        = UnityContainerFactory.GetContainer().Resolve <IWeatherService>();
 }
        public WeatherViewModel(ILocationService locationService, IWeatherService weatherService)
        {
            this.locationService = locationService;
            this.weatherService  = weatherService;

            this.LoadCurrentLocation();
        }
 public WeatherTriggerListener(ITriggeredFunctionExecutor executor,
                               IWeatherService weatherService, WeatherTriggerAttribute attribute)
 {
     this._executor       = executor;
     this._weatherService = weatherService;
     this._attribute      = attribute;
 }
Example #13
0
 public TemperatureFacade(IValueConverter <double> converter, IGeoLookupService geoLookupService,
                          IWeatherService weatherService)
 {
     _converter        = converter;
     _geoLookupService = geoLookupService;
     _weatherService   = weatherService;
 }
Example #14
0
 public WeatherCommand(DiscordClient client, Config config, IEventLogger logger, IWeatherService weatherSvc)
 {
     _client     = client;
     _config     = config;
     _logger     = logger;
     _weatherSvc = weatherSvc;
 }
Example #15
0
 public void SetupWeatherService()
 {
     if (weatherService == null)
     {
         weatherService = new WeatherService();
     }
 }
 public ConsoleHostedService(ILogger <ConsoleHostedService> logger,
                             IHostApplicationLifetime appLifetime, IWeatherService weatherService)
 {
     _logger         = logger;
     _appLifetime    = appLifetime;
     _weatherService = weatherService;
 }
 public DisplayController(IOptions <AppSettings> appSettings, ICalenderService calenderService, IWeatherService weatherService, IBusService busService)
 {
     _appSettings     = appSettings;
     _calenderService = calenderService;
     _weatherService  = weatherService;
     _busService      = busService;
 }
Example #18
0
        public ControllerSlaveService(
            ISettingsService settingsService,
            ISchedulerService scheduler,
            IDateTimeService dateTimeService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService,
            ILogService logService)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }

            _dateTimeService           = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));
            _outdoorTemperatureService = outdoorTemperatureService ?? throw new ArgumentNullException(nameof(outdoorTemperatureService));
            _outdoorHumidityService    = outdoorHumidityService ?? throw new ArgumentNullException(nameof(outdoorHumidityService));
            _daylightService           = daylightService ?? throw new ArgumentNullException(nameof(daylightService));
            _weatherService            = weatherService ?? throw new ArgumentNullException(nameof(weatherService));

            _log = logService?.CreatePublisher(nameof(ControllerSlaveService)) ?? throw new ArgumentNullException(nameof(logService));

            settingsService.CreateSettingsMonitor <ControllerSlaveServiceSettings>(s => Settings = s.NewSettings);

            scheduler.RegisterSchedule("ControllerSlavePolling", TimeSpan.FromMinutes(5), () => PullValues());
        }
        public ControllerSlaveService(
            ISettingsService settingsService,
            ISchedulerService scheduler,
            IDateTimeService dateTimeService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService)
        {
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (scheduler == null) throw new ArgumentNullException(nameof(scheduler));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));

            _dateTimeService = dateTimeService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
            _daylightService = daylightService;
            _weatherService = weatherService;

            settingsService.CreateSettingsMonitor<ControllerSlaveServiceSettings>(s => Settings = s);

            scheduler.RegisterSchedule("ControllerSlavePolling", TimeSpan.FromMinutes(5), PullValues);
        }
        public RollerShutterAutomation(
            AutomationId id,
            IHomeAutomationTimer timer,
            IDaylightService daylightService,
            IWeatherService weatherService,
            IComponentController componentController)
            : base(id)
        {
            if (timer == null)
            {
                throw new ArgumentNullException(nameof(timer));
            }
            if (daylightService == null)
            {
                throw new ArgumentNullException(nameof(daylightService));
            }
            if (weatherService == null)
            {
                throw new ArgumentNullException(nameof(weatherService));
            }
            if (componentController == null)
            {
                throw new ArgumentNullException(nameof(componentController));
            }

            _timer               = timer;
            _daylightService     = daylightService;
            _weatherService      = weatherService;
            _componentController = componentController;

            SpecialSettingsWrapper = new RollerShutterAutomationSettingsWrapper(Settings);
        }
Example #21
0
 public WeatherController(
     IWeatherService service,
     ILogger <WeatherController> logger)
 {
     _service = service;
     _logger  = logger;
 }
Example #22
0
        public LocationWeatherListViewModel(IWeatherService weatherService, ILocationSearchService locationSearchServiceService)
        {
            _weatherService = weatherService;
            _locationSearchServiceService = locationSearchServiceService;
            Title = "Browse Weather";
            LocationWeatherList = new ObservableCollection <LocationWeather>();
            LoadItemsCommand    = new Command(async() => await ExecuteLoadLocationListFromDataStoreCommandAsync());

            RemoveItemCommand = new Command <string>(async(key) => await ExecuteRemoveItemFromDataStoreCommandAsync(key));

            MessagingCenter.Subscribe <SearchLocationListPage, Location>(this, "AddItem", async(obj, location) =>
            {
                var weatherList     = await _weatherService.GetCurrentWeatherByLocationAsync(location.Key);
                var locationWeather = new LocationWeather
                {
                    Location       = location,
                    CurrentWeather = weatherList.FirstOrDefault()
                };

                var locationIsPresented = LocationWeatherList.Any(lw => lw?.Location?.Key == location.Key);
                if (!locationIsPresented)
                {
                    LocationWeatherList.Add(locationWeather);
                }

                await _locationSearchServiceService.AddLocationAsync(location);
            });
        }
Example #23
0
 public ForecastListVM(IStorageService storageService, Messenger messenger, IWeatherService weatherService)
 {
     storage   = storageService;
     Messenger = messenger;
     storage.AddForecast(weatherService.GetWeatherByName("Baku"));
     storage.AddForecast(weatherService.GetWeatherByName("Ganja"));
 }
 public CityWeatherSearchService(
     IWeatherService weatherService,
     ICityRepository cityRepository)
 {
     _weatherService = weatherService ?? throw new ArgumentNullException(nameof(weatherService));
     _cityRepository = cityRepository ?? throw new ArgumentNullException(nameof(cityRepository));
 }
        public MainWindow(IWeatherService weatherService, ILogger <MainWindow> logger)
        {
            InitializeComponent();

            this.weatherService = weatherService;
            this.logger         = logger;
        }
 public WeatherController(
     IWeatherService weatherService,
     IMapper mapper)
 {
     _weatherService = weatherService;
     _mapper         = mapper;
 }
 public WeatherTriggerConfigProvider(INameResolver nameResolver,
                                     ILoggerFactory loggerFactory, IWeatherService weatherService)
 {
     this._nameResolver   = nameResolver;
     this._loggerFactory  = loggerFactory;
     this._weatherService = weatherService;
 }
Example #28
0
        public ForecastController(IWeatherService weatherService)
        {
            if(weatherService == null)
                throw new ArgumentNullException(nameof(weatherService));

           _weatherService = weatherService;
        }
Example #29
0
 public PinInfoPopupViewModel(
     INavigationService navigationService,
     IWeatherService weatherService)
     : base(navigationService)
 {
     _weatherService = weatherService;
 }
 public WeatherForecastBlobTrigger(
     ILogger <WeatherForecastBlobTrigger> logger,
     IWeatherService weatherService)
 {
     this.logger         = logger;
     this.weatherService = weatherService;
 }
 public WeatherBusinessLogic(
     IWeatherService weatherService,
     IAutoMapper autoMapper)
 {
     _weatherService = weatherService;
     _autoMapper     = autoMapper;
 }
Example #32
0
        static async Task Main(string[] args)
        {
            IConfiguration     configuration     = GetConfiguration();
            IServiceCollection serviceCollection = GetConfiguredServices(configuration);
            IServiceProvider   serviceProvider   = serviceCollection.BuildServiceProvider();
            IWeatherService    weatherService    = serviceProvider.GetService <IWeatherService>();

            if (weatherService == null)
            {
                return;
            }

            System.Console.WriteLine("Please, enter city name:");
            string data = System.Console.ReadLine();

            try
            {
                await weatherService.ProcessWeatherForecastAsync(data);

                System.Console.WriteLine("The weather forecast was written to a file");
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }

            System.Console.WriteLine("Please, press any key to finish the program");
            System.Console.ReadKey();
        }
        public OpenWeatherMapService(
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService,
            IDateTimeService dateTimeService, 
            ISchedulerService schedulerService, 
            ISystemInformationService systemInformationService,
            ISettingsService settingsService, 
            IStorageService storageService)
        {
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (systemInformationService == null) throw new ArgumentNullException(nameof(systemInformationService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (storageService == null) throw new ArgumentNullException(nameof(storageService));

            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
            _daylightService = daylightService;
            _weatherService = weatherService;
            _dateTimeService = dateTimeService;
            _systemInformationService = systemInformationService;
            _storageService = storageService;

            settingsService.CreateSettingsMonitor<OpenWeatherMapServiceSettings>(s => Settings = s);

            LoadPersistedData();

            schedulerService.RegisterSchedule("OpenWeatherMapServiceUpdater", TimeSpan.FromMinutes(5), Refresh);
        }
Example #34
0
 public WorkerService(ILogger <WorkerService> log, IConfiguration config, IWeatherService weatherService, ISendingService sendingService)
 {
     _log            = log;
     _config         = config;
     _weatherService = weatherService;
     _sendingService = sendingService;
 }
Example #35
0
 public CityWeather(string cityAndState, IWeatherService weatherService)
 {
     _wf = new ObservableCollection<WeatherForecast>();
     _wc = new CurrentWeatherConditions();
     _weatherService = weatherService;
     _cityAndState = cityAndState;
     LoadWeather();
 }
 public WeatherContentViewModel()
 {
     _ws = new WeatherService();
     SearchCommand = new Command(Search);
     var now = DateTime.Now;
     CurrentDate = DateTime.Today.ToString("M");
     TomorrowDate = now.AddDays(1).ToString("dd-MM-yy");
     DayAfterTomorrowDate = now.AddDays(2).ToString("dd-MM-yy");
     DayAfterAfterTomorrowDate = now.AddDays(3).ToString("dd-MM-yy");
 }
        public MainViewModel(IWeatherService weatherService, ILocationService locService)
        {
            this.weatherService = weatherService;
            this.locService = locService;

            Task.Run(async () =>
            {
                var currentLocation = await this.locService.GetCurrentLocation();
                CurrentWeather = await this.weatherService.GetCurrentLocationWeather(currentLocation);
            });
        }
Example #38
0
 public MainViewModel(ICityService cityService, IWeatherService weatherService, IMessenger messenger)
 {
     IncrementRunCount();
     CheckForPreviousException();
     _cityService = cityService;
     _weatherService = weatherService;
     _messenger = messenger;
     _messenger.Register<RefreshMessage>(this, HandleRefreshMessage);
     Cities = _cityService.Cities;
     LoadWeather();
 }
        public async void GetWeatherCallsExecute()
        {
            var restClient = new Mock<IRestClient>();
            restClient.Setup(o => o.Execute(It.IsAny<IRestRequest>())).Returns(TestData.MockResult());
            restClient.Setup(o => o.ExecuteTaskAsync(It.IsAny<IRestRequest>())).ReturnsAsync(new RestResponse());

            _weatherService = new BbcWeatherService(restClient.Object, ApiUrl);
            await _weatherService.GetWeather(Location);

            restClient.Verify(o => o.ExecuteTaskAsync(It.IsAny<IRestRequest>()));
        }
        public void GetWeatherDeserializesResult()
        {
            var restClient = new Mock<IRestClient>();
            var json = "{\"Location\":\"Liverpool\",\"TemperatureCelsius\":22.0,\"WindSpeedKph\":6.0}";
            restClient.Setup(o => o.Execute(It.IsAny<IRestRequest>())).Returns(TestData.MockResult(json));

            _weatherService = new BbcWeatherService(restClient.Object, ApiUrl);

            var result = _weatherService.GetWeather(Location);
            result.Should().NotBeNull();
        }
Example #41
0
 private static void StopService(IWeatherService srv, IContainer container)
 {
     try
     {
         srv.Stop();
         container.Dispose();
     }
     catch (Exception err)
     {
         EventLog.WriteEntry(Weatherservice, err.ToString(), EventLogEntryType.Error);
     }
 }
Example #42
0
 public DerController(IDerService derService, IDropdownService dropdownService, IArtifactService artifactService, IHighlightService highlightService, IWeatherService weatherService, IKpiAchievementService kpiAchievementService, IKpiTargetService kpiTargetService, IVesselScheduleService vesselScheduleService, IWaveService waveService)
 {
     _derService = derService;
     _dropdownService = dropdownService;
     _artifactService = artifactService;
     _highlightService = highlightService;
     _weatherService = weatherService;
     _kpiAchievementService = kpiAchievementService;
     _kpiTargetService = kpiTargetService;
     _vesselScheduleService = vesselScheduleService;
     _waveService = waveService;
 }
Example #43
0
        public WeatherViewModel(INavigationService navigation, IWeatherService service, ICityService cityService)
        {
            _navigationService = navigation;
            _service = service;
            _cityService = cityService;
            _weatherForecast = new ObservableCollection<WeatherForecast>();
            _currentConditions = new CurrentWeatherConditions();

            ToAddCityCommand = new RelayCommand(() => _navigationService.Navigate(new Uri("/View/AddCityView.xaml", UriKind.Relative)));
            LoadCities();
            //load the weather
            LoadWeather();
        }
 public void SetUp()
 {
     checkWeather = new WeatherChecker();
     weatherData = new List<WeatherCheckerData> { houston, dallas, austin, boston };
     mocks = new MockRepository();
     weatherServiceMock = mocks.Stub<IWeatherService>();
     using (mocks.Record())
     {
         SetupResult.For(weatherServiceMock.getCityData("New York")).Return(newyork);
         SetupResult.For(weatherServiceMock.getCityData("Boston")).Return(boston);
         SetupResult.For(weatherServiceMock.getCityData("Houston")).Return(houston);
         SetupResult.For(weatherServiceMock.getCityData("Austin")).Return(austin);
         SetupResult.For(weatherServiceMock.getCityData("Dallas")).Return(dallas);
     }
 }
Example #45
0
 public HighlightController(IHighlightService highlightService,
     ISelectService selectService,
     INLSService nlsService,
     IVesselScheduleService vesselScheduleService,
     IWeatherService weatherService,
     IHighlightOrderService highlightOrderService,
     IHighlightGroupService highlightGroupService
     )
 {
     _highlightService = highlightService;
     _selectService = selectService;
     _nlsService = nlsService;
     _vesselScheduleService = vesselScheduleService;
     _waetherService = weatherService;
     _highlightOrderService = highlightOrderService;
     _highlightGroupService = highlightGroupService;
 }
 public OldMainViewModel(IWeatherService service)
 {
     this.service = service;
     this.City = new ReactiveProperty<string>();
     this.Temperature = new ReactiveProperty<string>();
     this.Wind = new ReactiveProperty<string>();
     this.Humidity = new ReactiveProperty<string>();
     this.ImageResource = new ReactiveProperty<string>();
     this.PreviousImageResource = new ReactiveProperty<string>();
     this.CurrentImageResource = new ReactiveProperty<string>();
     this.NextImageResource = new ReactiveProperty<string>();
     this.PreviousName = new ReactiveProperty<string>();
     this.CurrentName = new ReactiveProperty<string>();
     this.NextName = new ReactiveProperty<string>();
     this.Phrase = new ReactiveProperty<string>("loading\n<red>f*****g</red>\nweather...");
     this.IsLoading = new ReactiveProperty<bool>();
     this.RefreshCommand = new AsyncDelegateCommand(_ => this.Reload());
 }
Example #47
0
        public static WeatherInfo ForZipCode(IWeatherService weatherService, string zipCode)
        {
            try
            {
                var weatherInfo = new WeatherInfo();
                weatherInfo.UpdateForZipCode(weatherService, zipCode);

                return weatherInfo;
            }
            catch (WebException webException)
            {
                throw new WeatherException("There was a network error while connecting to the weather service.", webException);
            }
            catch (XmlException xmlException)
            {
                throw new WeatherException("There was an xml error while parsing weather data from the weather service.", xmlException);
            }
        }
 public NewMainViewModel(IWeatherService service, IResources resources)
 {
     this.service = service;
     this.resources = resources;
     this.City = new ReactiveProperty<string>();
     this.Temperature = new ReactiveProperty<string>();
     this.Wind = new ReactiveProperty<string>();
     this.Humidity = new ReactiveProperty<string>();
     this.ImageResource = new ReactiveProperty<string>();
     this.PreviousImageResource = new ReactiveProperty<string>();
     this.CurrentImageResource = new ReactiveProperty<string>();
     this.NextImageResource = new ReactiveProperty<string>();
     this.PreviousName = new ReactiveProperty<string>();
     this.CurrentName = new ReactiveProperty<string>();
     this.NextName = new ReactiveProperty<string>();
     this.Phrase = new ReactiveProperty<string>(this.resources.LoadingPhrase);
     this.IsLoading = new ReactiveProperty<bool>();
     this.RefreshCommand = new AsyncDelegateCommand(_ => this.Reload());
 }
        public PersonalAgentService(
            SynonymService synonymService,
            IComponentService componentService,
            IAreaService areaService,
            IWeatherService weatherService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService)
        {
            if (synonymService == null) throw new ArgumentNullException(nameof(synonymService));
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (areaService == null) throw new ArgumentNullException(nameof(areaService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));

            _synonymService = synonymService;
            _componentService = componentService;
            _areaService = areaService;
            _weatherService = weatherService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
        }
Example #50
0
 public DerTransactionController(IDerService derService, 
     IDerTransactionService derTransactionService, 
     IKpiAchievementService kpiAchievementService, 
     IKpiTargetService kpiTargetService, 
     IHighlightService highlightService, 
     ISelectService selectService, 
     IWaveService waveService, 
     IWeatherService weatherService,
     IDerLoadingScheduleService derLoadingScheduleService,
     IKpiTransformationService kpiTransformationService)
 {
     _derService = derService;
     _derTransactionService = derTransactionService;
     _kpiAchievementService = kpiAchievementService;
     _kpiTargetService = kpiTargetService;
     _highlightService = highlightService;
     _selectService = selectService;
     _waveService = waveService;
     _weatherService = weatherService;
     _derLoadingScheduleService = derLoadingScheduleService;
     _kpiTransformationService = kpiTransformationService;
 }
Example #51
0
        private void UpdateForZipCode(IWeatherService weatherService, string zipCode)
        {
            string xmlBuffer = weatherService.GetConditionsForZipCode(zipCode);

            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml(xmlBuffer);

            var node_response = xmlDocument.FirstChild;
            var node_currentObservation = node_response["current_observation"];
            {
                Temperature = double.Parse(node_currentObservation["temp_c"].InnerText);
                WindSpeed = double.Parse(node_currentObservation["wind_kph"].InnerText);

                var node_displayLocation = node_currentObservation["display_location"];
                {
                    Location = new WeatherLocation();
                    Location.City = node_displayLocation["city"].InnerText;
                    Location.State = node_displayLocation["state"].InnerText;
                    Location.Country = node_displayLocation["country"].InnerText;
                    Location.Elevation = (int)double.Parse(node_displayLocation["elevation"].InnerText);
                }
            }
        }
        public WeatherViewModel(IRepository<WeatherSettings> repository, IWeatherService weatherService,
                                IEventAggregator eventAggregator)
        {
            EventAggregator = eventAggregator;

            _weatherService = weatherService;
            _weatherService.WeatherRetrieved += (s, e) => WeatherReport = e.Payload;

            _weatherSettings = repository.Load();

            GetLatestWeather();

            var timer = new DispatcherTimer
                            {
                                Interval = new TimeSpan(0, 1, 0, 0)
                            };

            timer.Tick += OnTimerElapsed;

            timer.Start();

            SubscribeToEvents();
        }
 public ThemeParkOrchestrator(IWeatherService weatherService,
     IWaitTimesRepository persister,
     IParkRecalculationPublisher parkRecalculationPublisher,
     IAnimalKingdomService animalKingdomService,
     ICaliforniaAdventureService californiaAdventureService,
     IDisneyLandService disneyLandService,
     IDisneyLandParisService disneyLandParisService,
     IEpcotService epcotService,
     IHollywoodStudiosService hollywoodStudiosService,
     IMagicKingdomService magicKingdomService,
     IWaltDisneyStudiosService waltDisneyStudiosService)
 {
     _weatherService = weatherService;
     _persister = persister;
     _parkRecalculationPublisher = parkRecalculationPublisher;
     _themeParkServices.Add(animalKingdomService);
     _themeParkServices.Add(californiaAdventureService);
     _themeParkServices.Add(disneyLandService);
     _themeParkServices.Add(disneyLandParisService);
     _themeParkServices.Add(epcotService);
     _themeParkServices.Add(hollywoodStudiosService);
     _themeParkServices.Add(magicKingdomService);
     _themeParkServices.Add(waltDisneyStudiosService);
 }
 public WeatherController(IWeatherService iservice)
 {
     _service = iservice;
 }
Example #55
0
 public WeatherController(IWeatherService wservice)
 {
     this._wservice = wservice;
 }
Example #56
0
 public WeatherController()
 {
     weatherService = new WeatherService(new OpenWeatherQueryBuilder());
 }
Example #57
0
 public WeatherCommand(Api bot, IWeatherService service, IWeatherParser parser)
 {
     this.bot = bot;
     this.service = service;
     this.parser = parser;
 }
Example #58
0
 public WeatherDataSource(IWeatherService service)
 {
     this.service = service;
 }
Example #59
0
 public ZipCodesController(IZipCodesService zipCodesService, IWeatherService weatherService)
 {
     _zipCodesService = zipCodesService;
     _weatherService = weatherService;
 }
Example #60
0
 public AddCityViewModel(ICityService cityService, IMessenger messenger, IWeatherService weatherService)
     : base(messenger)
 {
     _cityService = cityService;
     _weatherService = weatherService;
 }