public ConfigurationForm(ref LedSettings settings) { InitializeComponent(); ledSettings = settings; cbOSDPosition.DataSource = Enum.GetValues(typeof(OSDPosition)); cbOSDPosition.SelectedIndex = 0; PopulateSettingsToUI(); }
public TrayManager(LedSettings settinhgs) { ledSettings = settinhgs; numNotifyIcon = new NotifyIcon(); capsNotifyIcon = new NotifyIcon(); scrollNotifyIcon = new NotifyIcon(); ApplySettings(); }
public void UpdateSettings(LedSettings settings) { ledSettings = settings; if (ledSettings.EnableKeyLockLEDs) { refreshRequired = true; if (thread == null || thread.ThreadState != ThreadState.Running) { StartThread(); } } else { StopThread(); } }
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; }
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; }
public LedThread(ref LedSettings settings) { ledSettings = settings; }
public void UpdateSettings(LedSettings settings) { ledSettings = settings; ApplySettings(); }