Ejemplo n.º 1
0
        private void startWithWindowsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var menu = sender as ToolStripMenuItem;

            if (AutoRunHelper.Get())
            {
                AutoRunHelper.Clear();
                menu.Checked = false;
            }
            else
            {
                AutoRunHelper.Set();
                menu.Checked = true;
            }
        }
Ejemplo n.º 2
0
        private void ContextMenuControl_AutorunChanged(object sender, EventArgs e)
        {
            var menu = sender as ToolStripMenuItem;

            if (AutoRunHelper.Get())
            {
                AutoRunHelper.Clear();
                menu.Checked = false;
            }
            else
            {
                AutoRunHelper.Set();
                menu.Checked = true;
            }
        }
Ejemplo n.º 3
0
        private void InitializeComponent(UserSettings settings)
        {
            Application.ApplicationExit += Application_ApplicationExit;

            // init Context Menu
            contextMenuControl.SetProvider(settings.Provider);
            contextMenuControl.SetCoin(settings.Coin);
            contextMenuControl.SetCurrency(settings.Currency);
            contextMenuControl.SetValidCurrencies(tickerController.SupportedCurrencies);
            contextMenuControl.SetValidCoins(tickerController.SupportedCoins);
            contextMenuControl.SetRefreshInterval(settings.RefreshInterval);
            contextMenuControl.SetPercentageNotification(settings.PercentageNotification);
            contextMenuControl.SetDarkMode(settings.DarkMode);
            contextMenuControl.SetAutorun(AutoRunHelper.Get());
            contextMenuControl.SetHighlight(settings.Highlight);
            contextMenuControl.SetCurrentVersion();

            // init Event fired from Context Menu
            contextMenuControl.OpenUrlClicked             += ContextMenuControl_OpenUrlClicked;
            contextMenuControl.NewVersionAvailableClicked += ContextMenuControl_NewVersionAvailableClicked;
            contextMenuControl.ProviderChanged            += ContextMenuControl_ProviderChanged;
            contextMenuControl.CoinChanged                   += ContextMenuControl_CoinChanged;
            contextMenuControl.CurrencyChanged               += ContextMenuControl_CurrencyChanged;
            contextMenuControl.RefreshIntervalChanged        += ContextMenuControl_RefreshIntervalChanged;
            contextMenuControl.PercentageNotificationChanged += ContextMenuControl_PercentageNotificationChanged;
            contextMenuControl.HighlightChanged              += ContextMenuControl_HighlightChanged;
            contextMenuControl.DarkModeChanged               += ContextMenuControl_DarkModeChanged;
            contextMenuControl.AutorunChanged                += ContextMenuControl_AutorunChanged;
            contextMenuControl.ExitClicked                   += ContextMenuControl_ExitClicked;

            // Init Tray Icon
            TrayIcon = new NotifyIcon
            {
                ContextMenuStrip = contextMenuControl.ContextMenuStrip
            };

            TaskbarIconHelper.notifyIcon = TrayIcon;
            TaskbarIconHelper.DarkMode   = settings.DarkMode;
            TaskbarIconHelper.Highlight  = settings.Highlight;

            TrayIcon.Click       += TrayIcon_Click;
            TrayIcon.DoubleClick += TrayIcon_DoubleClick;

            TrayIcon.Visible = true;
        }