Example #1
0
        public override void Initialize()
        {
            base.Initialize();

            Camera        = (ICameraService)Game.Services.GetService(typeof(ICameraService));
            LightService  = (ILightService)Game.Services.GetService(typeof(ILightService));
            EffectService = (IEffectService)Game.Services.GetService(typeof(IEffectService));
        }
Example #2
0
        public override void Initialize()
        {
            base.Initialize();

            Camera = (ICameraService)Game.Services.GetService(typeof(ICameraService));
            LightService = (ILightService)Game.Services.GetService(typeof(ILightService));
            EffectService = (IEffectService)Game.Services.GetService(typeof(IEffectService));
        }
 public GameControllerViewModel(IDeviceService deviceService, ILightService lightService, IButtonMapperStrategy buttonMapperStrategy, IMessenger messenger, IConfigurationService configurationService)
 {
     this._deviceService        = deviceService;
     this._lightService         = lightService;
     this._buttonMapperStrategy = buttonMapperStrategy;
     this._messenger            = messenger;
     this._configurationService = configurationService;
     _messenger.Register <ButtonChangedMessage>(this, this.HandleButtonMessage);
     InitCommands();
     Configuration = configurationService.ReadConfiguration();
     InitGameControllerList(null);
 }
Example #4
0
        public override void SetupInitialization(ShaderInitializer initializer)
        {
            var services  = initializer.Services;
            var technique = initializer.Technique;
            InitializerParameters parameters = new InitializerParameters(-1, technique, services, StaticSelector);
            var data = from metaData in technique.MetaData
                       where metaData.Key == Param.Properties.LightId
                       select Int32.Parse(metaData.Value);

            ILightService lightService = services.GetService <ILightService>();

            foreach (int lightId in data)
            {
                initializer.Initialize(this, lightService[lightId], parameters);
            }
        }
Example #5
0
        public void ChartHandler(ILightService lightService)
        {
            var delay = TimeSpan.FromSeconds(60);

            var periodicTimer = ThreadPoolTimer.CreatePeriodicTimer(
                (source) =>
            {
                foreach (var light in lightService.LightModelList)
                {
                    if (light.LightStatus)
                    {
                        light.BulbOnTimeInMinutesPerDay++;
                        light.BulbOffTimeInMinutesPerDay--;
                        Debug.WriteLine($"Value of bulbOffTimeInMinutes changed, new value {light.BulbOffTimeInMinutesPerDay} " +
                                        $"and bulbOffTimeInMinutes changed, new value {light.BulbOnTimeInMinutesPerDay} date: {DateTime.Now}");
                    }
                }
            }, delay);
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IDiscordService discordService,
                              IMqttService mqttService, ILightService lightService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors("AllowAll");

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <DiscordHub>("/hub/discord");
                endpoints.MapHub <LightHub>("/hub/light");
            });
        }
        public LightControlerPageViewModel(ISignalRService signalRService, ILightService lightService)
        {
            _lightService      = lightService;
            DisplayLightModels = new ObservableCollection <DisplayLightModel>();

            foreach (var bulb in lightService.LightModelList)
            {
                DisplayLightModels.Add(
                    new DisplayLightModel()
                {
                    Name            = bulb.Name,
                    LightStatus     = UriChanger(bulb.LightStatus),
                    LightBulbNumber = bulb.ID.ToString(),
                    Command         = new DelegateCommand <string>(async(args) =>
                    {
                        bulb.LightStatus = !bulb.LightStatus;
                        await signalRService.InvokeTurnOnLight(
                            bulb.LightStatus, int.Parse(args));
                    })
                });
            }
            lightService.StatusOfLightPropertyChanged += LightService_PropertyChanged;
        }
Example #8
0
 public LightsViewModel(ILightService lightService)
 {
     _lightService = lightService;
     Init();
 }
Example #9
0
 public DeviceService(IDeviceRepository deviceRepo, IButtonMapperStrategy buttonMapperStrategy, ILightService lightService)
 {
     this._deviceRepo           = deviceRepo;
     this._buttonMapperStrategy = buttonMapperStrategy;
     this._lightService         = lightService;
 }
Example #10
0
 public HomeAssistance(ICalendarService calendarService, ISpotifyService spotifyService, ILightService lightService)
 {
     _calendarService = calendarService;
     _spotifyService  = spotifyService;
     _lightService    = lightService;
 }