public WeatherForecastController(IDropdownCity cityList, IWeatherForecast weatherService,
     IFavoriteCityContext context)
 {
     this.cityList = cityList;
     this.weatherService = weatherService;
     this.context = context;
 }
示例#2
0
        public MowController(
            IMowControlConfig config,
            IPowerSwitch powerSwitch,
            IWeatherForecast weatherForecast,
            ISystemTime systemTime,
            IHomeSensor homeSensor,
            IMowLogger logger,
            IRainSensor rainSensor,
            bool?mowerIsHome = null)
        {
            Config          = config;
            PowerSwitch     = powerSwitch;
            WeatherForecast = weatherForecast;
            SystemTime      = systemTime;
            HomeSensor      = homeSensor;
            Logger          = logger;
            RainSensor      = rainSensor;

            if (mowerIsHome.HasValue)
            {
                _mowerIsHome = mowerIsHome.Value;
            }
            else
            {
                _mowerIsHome = HomeSensor.IsHome;
            }
        }
        void CurrentConditions_OnWeatherUpdated(IWeatherForecast _weatherForecastProvider)
        {
            if (_screen != null)
            {
                //clear the display
                _screen.Clear();

                Render(null);


                //flush the image out to the device
                _screen.Flush();
            }
        }
        public DashBoardService(DbConnection Parameter, IWeatherForecast iWeatherForecast,
                                IIPRequestDetails iIPRequestDetails, IEmailService iEmailService)
        {
            SqlInsightDbProvider.RegisterProvider();
            //  string sqlConnection = "Data Source=.;Initial Catalog=EmployeeManage;Integrated Security=True";
            string sqlConnection = Caching.Instance.GetApplicationConfigs("DBConnection")
            ;
            DbConnection c = new SqlConnection(sqlConnection);

            _IUserAccountRepository = c.As <IUserAccountRepository>();
            _IIPRequestDetails      = iIPRequestDetails;

            _IWeatherForecast = iWeatherForecast;
            _IEmailService    = iEmailService;
        }
        public void SetUp()
        {
            var moq = new Mock <IWeatherForecast>();

            moq.Setup(wf => wf.GetSunlightPercentage(_hourOfTheDay1)).Returns(() =>
            {
                //TODO po weather provider metodama
                return(0); //return 0 da vs ne bi prijavljivao gresku na ovoj liniji
            });
            _proxy1 = moq.Object;

            var moq2 = new Mock <IWeatherForecast>();

            moq2.Setup(o => o.GetSunlightPercentage(_hourOfTheDay2)).Returns(() =>
            {
                //TODO po weather provider metodama
                return(0); //return 0 da vs ne bi prijavljivao gresku na ovoj liniji
            });
            _proxy2 = moq2.Object;
        }
示例#6
0
 public GetForecastGeneralInfoHandler(WeatherForecastContext context, IWeatherForecast weatherForecast, IConfiguration configuration)
 {
     _context         = context;
     _weatherForecast = weatherForecast;
     _configuration   = configuration;
 }
 public WeatherWatchFace()
 {
     CurrentConditions = WeatherProvider.Current;
     CurrentConditions.OnWeatherUpdated += CurrentConditions_OnWeatherUpdated;
 }
示例#8
0
 public WeatherForcastService(IWeatherForecast weatherForecast,
                              IWeatherForecastAverageCalculator weatherForecastAverageCalculator)
 {
     this._weatherForecast = weatherForecast;
     this._weatherForecastAverageCalculator = weatherForecastAverageCalculator;
 }
示例#9
0
 public IndexModel(ILogger <IndexModel> logger, IWeatherForecast weatherForecast)
 {
     _logger          = logger;
     _weatherForecast = weatherForecast;
 }
 public WeatherForecast2Controller(ILogger <WeatherForecast2Controller> logger, IWeatherForecast weatherForecast)
 {
     _logger          = logger;
     _weatherForecast = weatherForecast;
 }
 public double CalculatePower(IWeatherForecast proxy, double hourOfTheDay)
 {
     return(MaxPower * proxy.GetSunlightPercentage(hourOfTheDay) / 100);
 }
示例#12
0
 public void Setup()
 {
     this.WeatherForecast = new WeatherForecast();
 }
示例#13
0
 public GetForecastByCityHandler(WeatherForecastContext context, IWeatherForecast weatherForecast, IConfiguration configuration)
 {
     _context         = context;
     _weatherForecast = weatherForecast;
     _configuration   = configuration;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WeatherForecastController"/> class.
 /// </summary>
 /// <param name="weatherForecast">The weather Forecast.</param>
 public WeatherForecastController(IWeatherForecast weatherForecast)
 {
     this.weatherForecast = weatherForecast;
 }
 public ICity Translate(IWeatherForecast weatherForecast)
 {
     return(_cityFactory.Create(weatherForecast.CityName, weatherForecast.Code));
 }
示例#16
0
 public GenerationPrediction(IPowerPlantModel powerPlantModel, IWeatherForecast weatherForecast)
 {
     _powerPlantModel = powerPlantModel;
     _weatherForecast = weatherForecast;
 }
 public IEnumerable <WeatherForecast> Get([FromServices] IWeatherForecast weatherForecast)
 => weatherForecast.ListWeatherForecast();
 public WeatherForecastController(IWeatherForecast weather)
 {
     _weather = weather;
 }
 public WeatherController(ILogger <WeatherController> logger, IWeatherForecast weatherForecast, IMediator mediator)
 {
     _logger          = logger;
     _weatherForecast = weatherForecast;
     _mediator        = mediator;
 }