Exemple #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();
            }
        }
Exemple #2
0
 public ConfigViewModel(AmbilightSettings settings)
 {
     this.Settings = settings;
 }
 public AmbilightExtendBrush(IScreenCapture screenCapture, AmbilightSettings settings)
     : base(screenCapture, settings)
 {
 }
Exemple #4
0
 public AmbilightMirrorBrush(IScreenCapture screenCapture, AmbilightSettings settings)
     : base(screenCapture, settings)
 {
 }
Exemple #5
0
 public Ambilight(IScreenCapture screenCapture, AmbilightSettings settings)
 {
     this._screenCapture = screenCapture;
     this._settings      = settings;
 }
Exemple #6
0
 public AbstractAmbilightBrush(IScreenCapture screenCapture, AmbilightSettings settings)
 {
     this.ScreenCapture = screenCapture;
     this.Settings      = settings;
 }