Example #1
0
 public MeteoService(IRepository<Location> locationRepository, IRepository<WeatherForecast> weatherForecastRepository)
 {
     _locationRepository = locationRepository;
     _weatherForecastRepository = weatherForecastRepository;
     _xmlService = new XmlService();
     _webClientService = new WebClientService();
     _openWeatherService = new OpenWeatherService();
     _worldWeatherOnlineService = new WorldWeatherOnlineService();
 }
Example #2
0
 public List<WeatherForecast> GetHistoricalWeatherList(string apiKey, List<string> cityNameList, string date, string endDate, IWebClientService webClientService, IXmlService xmlService, IOpenWeatherService openWeatherService)
 {
     List<WeatherForecast> weatherHistoricalForecast = new List<WeatherForecast>();
     foreach (string cityName in cityNameList)
     {
         List<WeatherForecast> weatherHistoricalForecastByCity = GetHistoricalWeatherList(apiKey, cityName, date, endDate, webClientService, xmlService, openWeatherService);
         weatherHistoricalForecast.AddRange(weatherHistoricalForecastByCity);
     }
     return weatherHistoricalForecast;
 }
Example #3
0
        public void InitTest()
        {
            xmlServiceMock = new Mock<IXmlService>();
            webClientServiceMock = new Mock<IWebClientService>();
            openWeatherServiceMock = new Mock<IOpenWeatherService>();
            xmlService = new XmlService();
            webClientService = new WebClientService();
            openWeatherService = new OpenWeatherService();

            IDbContext dbContext = new MeteoContext();
            IRepository<Location> locationRepository = new EfRepository<Location>(dbContext);
            IRepository<WeatherForecast> weatherForecastRepository = new EfRepository<WeatherForecast>(dbContext);
            meteoService = new MeteoService(locationRepository, weatherForecastRepository);
        }
Example #4
0
 public List<WeatherForecast> GetHistoricalWeatherList(string apiKey, string cityName, string date, string endDate, IWebClientService webClientService, IXmlService xmlService, IOpenWeatherService openWeatherService)
 {
     //string url = @"http://api.worldweatheronline.com/free/v2/past-weather.ashx?key={apiKey}&q={cityName}&format=xml&includeLocation=yes&date={date}&enddate={endDate}";
     string url = ConfigurationManager.AppSettings["historicalWeatherUrl"];
     url = url.Replace("{apiKey}", apiKey);
     url = url.Replace("{cityName}", cityName);
     url = url.Replace("{date}", date);
     url = url.Replace("{endDate}", endDate);
     LogHelper.WriteToLog("meteo.log", url);
     string weatherString = webClientService.Get(url);
     XDocument weatherDocument = xmlService.GetXmlDoc(weatherString);
     Location location = GetLocation(cityName);
     List<WeatherForecast> weatherHistoricalForecast = _worldWeatherOnlineService.GetWeatherHistoricalForecast(_worldWeatherOnlineService, xmlService, weatherDocument, location);
     return weatherHistoricalForecast;
 }
Example #5
0
 public SettingsPresenter(ISettingsView view)
 {
     this.view = view;
     try
     {
         xmlService = new XmlService();
         webClientService = new WebClientService();
         openWeatherService = new OpenWeatherService();
         dbContext = new MeteoContext();
         locationRepository = new EfRepository<Location>(dbContext);
         weatherForecastRepository = new EfRepository<WeatherForecast>(dbContext);
         meteoService = new MeteoService(locationRepository, weatherForecastRepository);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public MatchesController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
 public FilmsController(IWebClientService clientService)
 {
     _clientService = clientService;
 }
 /// <summary>
 /// Initialises a new instance of the RefController class.
 /// </summary>
 /// <param name="validationService"><c>ValidationService</c> instance.</param>
 /// <param name="webClientService"><c>WebClientService</c> instance.</param>
 public V3Controller(IValidationService validationService, IWebClientService webClientService)
     : base(validationService, webClientService)
 {
 }
 public QuestionsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #10
0
 public UpdaterProvider(IApplicationExitProvider applicationExitProvider, IFileService fileService, IDirectoryService directoryService, IWebClientService webClientService, IPathService pathService, IAssemblyService assemblyService, IProcessStarterService processStarterService, IGuidGeneratorService guidGeneratorService, IIsCurrentVersionProvider isCurrentVersionProvider, IGlobalLogService globalLogService)
 {
     this._applicationExitProvider  = applicationExitProvider;
     this._fileService              = fileService;
     this._directoryService         = directoryService;
     this._webClientService         = webClientService;
     this._pathService              = pathService;
     this._assemblyService          = assemblyService;
     this._processStarterService    = processStarterService;
     this._guidGeneratorService     = guidGeneratorService;
     this._isCurrentVersionProvider = isCurrentVersionProvider;
     this._globalLogService         = globalLogService;
 }
Example #11
0
 public QuestionsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
 public GraphService(IWebClientService conection) : base(conection)
 {
 }
 public MovieWebService(IWebClientService conection)
 {
     this.conection = conection;
 }
Example #14
0
 public SetupManager(IAssetBuilder assetBuilder, IWebClientService webClientService)
 {
     _assetBuilder     = assetBuilder;
     _webClientService = webClientService;
 }
 public PredictionsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #16
0
 public MissioContext(DbContextOptions <MissioContext> options, IPasswordHasher <User> passwordService, IWebClientService webClientService) : base(options)
 {
     _webClientService = webClientService;
     _passwordService  = passwordService;
 }
        public DispenserPresenter(IDispenserView dispenserView, CoinStoragePresenter coinStoragePresenter, IWebClientService coinService, IWebClientService drinkService)
        {
            _dispenserView = dispenserView;
            _coinService   = coinService;
            _drinkService  = drinkService;
            //_coinStorageView = coinStorageView;
            _coinStoragePresenter = coinStoragePresenter;

            _coinsInserted = new List <CoinStore>();
            FillDispenser();

            //subscriptions
            EventAggregator.Instance.Subscribe <ApplicationMessageGeneric <CoinStore> >(OnCoinSelected);
            EventAggregator.Instance.Subscribe <ApplicationMessageGeneric <Drink> >(OnDrinkSelected);

            dispenserView.Cancel += OnCancel;
            dispenserView.Order  += OnOrdering;
        }
Example #18
0
 public TestsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #19
0
 public MatchesController(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }
Example #20
0
 public void InitTest()
 {
     webClientService = new WebClientService();
 }
Example #21
0
 public RetryWebClientServiceDecorator(IWebClientService webClientServiceImplementation)
 {
     this._webClientServiceImplementation = webClientServiceImplementation;
 }
Example #22
0
 public FoursquareAdapter(ILogger logger, IWebClientService webClient, IKmlCalculator kmlCalculator)
 {
     _logger        = logger;
     _webClient     = webClient;
     _kmlCalculator = kmlCalculator;
 }
Example #23
0
 /// <summary>
 /// Construtor do serviço de Juros.
 /// </summary>
 /// <param name="loggingService">Instância do Serviço de Logging.</param>
 /// <param name="config">Instance of IConfiuration que armazena a configuração do appsettings.json</param>
 /// <param name="webClientService">Cliente Web para realização de requisições HTTP.</param>
 public JurosService(ILoggingService <JurosService> loggingService, IConfiguration config, IWebClientService webClientService)
 {
     _loggingService   = loggingService;
     _config           = config;
     _webClientService = webClientService;
 }
Example #24
0
 public LoginsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #25
0
 public VeraService(IWebClientService webClientService, IVeraControllerService veraControllerService)
 {
     _webClientService      = webClientService;
     _veraControllerService = veraControllerService;
     SetUp();
 }
Example #26
0
 public FileDownloader(IWebClientService webClient)
 {
     _webClient = webClient;
 }
 public PlanetsController(IWebClientService clientService)
 {
     _clientService = clientService;
 }
Example #28
0
 public MatchesController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #29
0
 public LoginsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #30
0
 public BoxersController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
 public BaseDuplexService(IWebClientService web)
 {
     mWebClientService = web;
     mWebClientService.SetHanleCallback(SendMessage);
 }
Example #32
0
 public HomeController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
 public NewsfeedItemCoreViewModel(IWebClientService cookieWebClientService, INotificationService notificationService)
 {
     _cookieWebClientService = cookieWebClientService;
     _notificationService    = notificationService;
 }
Example #34
0
 public HomeController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
 public PredictionsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #36
0
 /// <summary>
 /// initialize
 /// </summary>
 public FeedService(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }
Example #37
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="youtubeService">YouTubeサービス</param>
        /// <param name="webClientService">Webクライエントサービス</param>
        public AddOrClonePlaylistItemsDialogViewModel(IYouTubeService youtubeService, IWebClientService webClientService)
        {
            m_YouTubeService   = youtubeService;
            m_WebClientService = webClientService;

            SearchWord         = new ReactivePropertySlim <string>().AddTo(m_Disposables);
            SearchResultList   = new ReactiveCollection <ChannelViewModel>().AddTo(m_Disposables);
            TargetPlaylistList = new ReactiveCollection <PlaylistViewModel>().AddTo(m_Disposables);
            TargetVideoList    = new ReactiveCollection <VideoViewModel>().AddTo(m_Disposables);
            SearchResultList   = new ReactiveCollection <ChannelViewModel>().AddTo(m_Disposables);
            SelectedItem       = new ReactivePropertySlim <ChannelViewModel>().AddTo(m_Disposables);
            ActiveTab          = new ReactivePropertySlim <ItemType>().AddTo(m_Disposables);

            // 選択アイテム・タブが変更されたらプレイリスト・動画一覧を更新
            SelectedItem.Subscribe(_ => UpdateActiveTab());
            ActiveTab.Subscribe(_ => UpdateActiveTab());
        }
Example #38
0
 public BoxersController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #39
0
 public AccountController(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }
Example #40
0
 public List<WeatherForecast> GetWeatherList(List<string> cityList, int forecastDaysCount, IWebClientService webClientService, IXmlService xmlService, IOpenWeatherService openWeatherService)
 {
     List<WeatherForecast> weatherForecasts = new List<WeatherForecast>();
     List<Location> currentLocations = GetLocations();
     foreach (string city in cityList)
     {
         WeatherForecast weatherForecast = GetWeather(city, forecastDaysCount, webClientService, xmlService, openWeatherService, currentLocations);
         weatherForecasts.Add(weatherForecast);
     }
     return weatherForecasts;
 }
Example #41
0
 public DotnetCrawlerPageLinkReader(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }
 /// <summary>
 /// Initialises a new instance of the BaseApiController class.
 /// </summary>
 /// <param name="validationService"><c>ValidationService</c> instance.</param>
 /// <param name="webClientService"><c>WebClientService</c> instance.</param>
 protected BaseApiController(IValidationService validationService, IWebClientService webClientService)
 {
     this.ValidationService = validationService;
     this.WebClientService = webClientService;
 }
Example #43
0
        private static UsersController MakeUsersController(MissioContext missioContext = null, IWebClientService webClientService = null)
        {
            if (missioContext == null)
            {
                missioContext = Utils.MakeMissioContext();
            }
            if (webClientService == null)
            {
                webClientService = Substitute.For <IWebClientService>();
            }
            var passwordService = new MockPasswordService();
            var userService     = new UsersService(missioContext, passwordService, webClientService);

            return(new UsersController(userService));
        }
Example #44
0
 public WeatherForecast GetWeather(string city, int forecastDaysCount, IWebClientService webClientService, IXmlService xmlService, IOpenWeatherService openWeatherService, List<Location> currentLocations)
 {
     string url = "http://api.openweathermap.org/data/2.5/forecast/daily?q=city&mode=xml&units=metric&cnt=forecastDaysCount";
     url = url.Replace("city", city);
     url = url.Replace("forecastDaysCount", forecastDaysCount.ToString());
     string weatherString = webClientService.Get(url);
     XDocument weatherDocument = xmlService.GetXmlDoc(weatherString);
     WeatherForecast weatherForecast = openWeatherService.GetWeatherForecast(openWeatherService, xmlService, weatherDocument, currentLocations, forecastDaysCount);
     return weatherForecast;
 }
Example #45
0
 public DotnetCrawlerDownloader(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }
 public TestsController(IWebClientService webClient)
 {
     this.webClient = webClient;
 }
Example #47
0
 public UsersController(IWebClientService webClientService)
 {
     _webClientService = webClientService;
 }