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; } }
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); }