예제 #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            try
            {
                _settings = SerializationHelper.LoadObjectFromFile<AmbilightSettings>(PATH_SETTINGS) ??
                    new AmbilightSettings();
                IScreenCapture screenCapture = new DX9ScreenCapture();

                // DarthAffe 05.11.2016: This could be done way cleaner ...
                _taskBar = FindResource("Taskbar") as TaskbarIcon;
                FrameworkElement configView = _taskBar?.TrayPopup as ConfigView;
                if (configView == null)
                    Shutdown();
                else
                    configView.DataContext = new ConfigViewModel(_settings);

                _ambilight = new Ambilight(screenCapture, _settings);
                if (!_ambilight.Initialize())
                    throw new ApplicationException();
            }
            catch
            {
                MessageBox.Show("An error occured while starting the Keyboard-Ambilight.\r\nPlease double check if CUE is running and 'Enable SDK' is checked.", "Can't start Keyboard-Ambilight");
                Shutdown();
            }
        }
예제 #2
0
 public AmbilightMirrorBrush(IScreenCapture screenCapture, AmbilightSettings settings)
     : base(screenCapture, settings)
 { }
예제 #3
0
 public AmbilightExtendBrush(IScreenCapture screenCapture, AmbilightSettings settings)
     : base(screenCapture, settings)
 { }
예제 #4
0
 public AbstractAmbilightBrush(IScreenCapture screenCapture, AmbilightSettings settings)
 {
     this.ScreenCapture = screenCapture;
     this.Settings = settings;
 }
예제 #5
0
 public Ambilight(IScreenCapture screenCapture, AmbilightSettings settings)
 {
     this._screenCapture = screenCapture;
     this._settings = settings;
 }