Ejemplo n.º 1
0
        public ConfigurationForm(ref LedSettings settings)
        {
            InitializeComponent();
            ledSettings = settings;
            cbOSDPosition.DataSource    = Enum.GetValues(typeof(OSDPosition));
            cbOSDPosition.SelectedIndex = 0;

            PopulateSettingsToUI();
        }
Ejemplo n.º 2
0
        public TrayManager(LedSettings settinhgs)
        {
            ledSettings = settinhgs;

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

            ApplySettings();
        }
Ejemplo n.º 3
0
 public void UpdateSettings(LedSettings settings)
 {
     ledSettings = settings;
     if (ledSettings.EnableKeyLockLEDs)
     {
         refreshRequired = true;
         if (thread == null || thread.ThreadState != ThreadState.Running)
         {
             StartThread();
         }
     }
     else
     {
         StopThread();
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 6
0
 public LedThread(ref LedSettings settings)
 {
     ledSettings = settings;
 }
Ejemplo n.º 7
0
 public void UpdateSettings(LedSettings settings)
 {
     ledSettings = settings;
     ApplySettings();
 }