Esempio n. 1
0
        public void SetProxyViewSource()
        {
            ProxyState state = _proxySwitcher.GetState();

            if (state == ProxyState.Enabled)
            {
                _buttonContent.Text            = "Proxy Enabled";
                _buttonContent.ButtonText      = "Disable";
                _buttonContent.TextColor       = ButtonContent.BrushChartreuse;
                _buttonContent.ButtonTextColor = ButtonContent.BrushCrimson;
            }
            else if (state == ProxyState.Disabled)
            {
                _buttonContent.Text            = "Proxy Disabled";
                _buttonContent.ButtonText      = "Enable";
                _buttonContent.TextColor       = ButtonContent.BrushCrimson;
                _buttonContent.ButtonTextColor = ButtonContent.BrushChartreuse;
            }
        }
Esempio n. 2
0
        private ProxyState ChangeContextMenuStripItemsByProxyState()
        {
            ProxyState state = _proxySwitcher.GetState();

            if (state == ProxyState.Disabled)
            {
                _notifyIcon.ContextMenuStrip.Items[0].Text = "Enable proxy";
                _notifyIcon.Icon = ProxyBoss.Properties.Resources.AppIconDisabled;
            }
            else if (state == ProxyState.Enabled)
            {
                _notifyIcon.ContextMenuStrip.Items[0].Text = "Disable proxy";
                _notifyIcon.Icon = ProxyBoss.Properties.Resources.AppIconEnabled;
            }

            if (_timer == null)
            {
                CreateTimer();
            }

            return(state);
        }