Пример #1
0
        public ConfigurationForm(ref LedSettings settings)
        {
            InitializeComponent();
            ledSettings = settings;
            cbOSDPosition.DataSource    = Enum.GetValues(typeof(OSDPosition));
            cbOSDPosition.SelectedIndex = 0;

            PopulateSettingsToUI();
        }
Пример #2
0
        public TrayManager(LedSettings settinhgs)
        {
            ledSettings = settinhgs;

            numNotifyIcon    = new NotifyIcon();
            capsNotifyIcon   = new NotifyIcon();
            scrollNotifyIcon = new NotifyIcon();

            ApplySettings();
        }
Пример #3
0
 public void UpdateSettings(LedSettings settings)
 {
     ledSettings = settings;
     if (ledSettings.EnableKeyLockLEDs)
     {
         refreshRequired = true;
         if (thread == null || thread.ThreadState != ThreadState.Running)
         {
             StartThread();
         }
     }
     else
     {
         StopThread();
     }
 }
Пример #4
0
        public LogiLockLEDApp()
        {
            appCon = new SynchronizationContext();

            ledSettings = new LedSettings();
            ledSettings.LoadSettings();

            configWindow = new ConfigurationForm(ref ledSettings);
            configWindow.SettingsUpdated += ConfigWindow_OnSettingsUpdated;
            popupWindow = new IndicatorPopup();
            popupWindow.Configure(ledSettings);

            ledThread = new LedThread(ref ledSettings);
            ledThread.KeylockUpdated += ledThread_OnKeylockUpdated;
            ledThread.StartThread();

            configEnableItem = new MenuItem("Enabled", new EventHandler(ToggleEnabled))
            {
                Checked = ledSettings.EnableKeyLockLEDs
            };

            notifyIcon      = new NotifyIcon();
            notifyIcon.Icon = Properties.Resources.appicon;
            contextMenu     = new ContextMenu(new MenuItem[] {
                new MenuItem("LogiLockLED")
                {
                    Enabled = false
                },
                new MenuItem("-"),
                configEnableItem,
                new MenuItem("Configuration", new EventHandler(ShowConfig)),
                new MenuItem("Restart App", new EventHandler(Restart)),
                new MenuItem("Exit", new EventHandler(Exit))
            });
            notifyIcon.ContextMenu  = contextMenu;
            notifyIcon.DoubleClick += ShowConfig;
            notifyIcon.Visible      = true;

            trayManager = new TrayManager(ledSettings);

            SystemEvents.PowerModeChanged += OnPowerModeChange;
            SystemEvents.SessionSwitch    += OnSystemSessionSwitch;
        }
Пример #5
0
        public void Configure(LedSettings settings)
        {
            lblLockText.Font = settings.OsdFont;

            cornerTL.Visible = settings.OsdRoundedCorners;
            cornerTR.Visible = settings.OsdRoundedCorners;
            cornerBL.Visible = settings.OsdRoundedCorners;
            cornerBR.Visible = settings.OsdRoundedCorners;

            showNum    = settings.OsdShowNum;
            showCaps   = settings.OsdShowCaps;
            showScroll = settings.OsdShowScroll;

            Position         = settings.OsdPosition;
            this.Padding     = new Padding(settings.OsdPadding, settings.OsdPadding, settings.OsdPadding, (int)(settings.OsdPadding) + 4);
            this.OuterMargin = settings.OsdMargin;

            lblLockText.ForeColor = settings.OsdTextColor;
            this.BackColor        = settings.OsdBackColor;
            this.Opacity          = settings.OsdOpacity / 100d;
            hideTimer.Interval    = settings.OsdDuration;
        }
Пример #6
0
 public LedThread(ref LedSettings settings)
 {
     ledSettings = settings;
 }
Пример #7
0
 public void UpdateSettings(LedSettings settings)
 {
     ledSettings = settings;
     ApplySettings();
 }