public void SaveLogViewerConfig(LogViewerConfig newConfig) { _config.logViewer = newConfig; newConfig.SaveSize(); Configuration.Save(_config); ConfigChanged?.Invoke(this, new EventArgs()); }
public void SaveLogViewerConfig(LogViewerConfig newConfig) { _config.logViewer = newConfig; Configuration.Save(_config); if (ConfigChanged != null) { ConfigChanged(this, new EventArgs()); } }
private void LogForm_FormClosing(object sender, FormClosingEventArgs e) { timer.Stop(); LogViewerConfig config = controller.GetConfigurationCopy().logViewer; if (config == null) { config = new LogViewerConfig(); } config.topMost = topMostTrigger; config.wrapText = wrapTextTrigger; config.toolbarShown = toolbarTrigger; config.SetFont(LogMessageTextBox.Font); config.SetBackgroundColor(LogMessageTextBox.BackColor); config.SetTextColor(LogMessageTextBox.ForeColor); controller.SaveLogViewerConfig(config); }
public LogForm(ShadowsocksController controller, string filename) { this.controller = controller; this.filename = filename; InitializeComponent(); Icon = Icon.FromHandle(Resources.ssw128_green.GetHicon()); LogViewerConfig config = controller.GetConfigurationCopy().logViewer; topMostTrigger = config.topMost; wrapTextTrigger = config.wrapText; toolbarTrigger = config.toolbarShown; LogMessageTextBox.BackColor = config.BackgroundColor; LogMessageTextBox.ForeColor = config.TextColor; LogMessageTextBox.Font = config.Font; controller.TrafficChanged += controller_TrafficChanged; UpdateTexts(); }
private void LogForm_FormClosing(object sender, FormClosingEventArgs e) { timer.Stop(); LogViewerConfig config = controller.GetConfigurationCopy().logViewer; config.topMost = topMostTrigger; config.wrapText = wrapTextTrigger; config.toolbarShown = toolbarTrigger; config.Font = LogMessageTextBox.Font; config.BackgroundColor = LogMessageTextBox.BackColor; config.TextColor = LogMessageTextBox.ForeColor; if (WindowState != FormWindowState.Minimized && !(config.Maximized = WindowState == FormWindowState.Maximized)) { config.Top = Top; config.Left = Left; config.Height = Height; config.Width = Width; } controller.SaveLogViewerConfig(config); }
private void LogForm_FormClosing(object sender, FormClosingEventArgs e) { timer.Stop(); controller.TrafficChanged -= controller_TrafficChanged; LogViewerConfig config = controller.GetConfigurationCopy().logViewer; config.topMost = topMostTrigger; config.wrapText = wrapTextTrigger; config.toolbarShown = toolbarTrigger; config.SetFont(LogMessageTextBox.Font); config.SetBackgroundColor(LogMessageTextBox.BackColor); config.SetTextColor(LogMessageTextBox.ForeColor); if (WindowState != FormWindowState.Minimized && !(config.maximized = WindowState == FormWindowState.Maximized)) { config.top = Top; config.left = Left; config.height = Height; config.width = Width; } controller.SaveLogViewerConfig(config); }
public LogForm(ShadowsocksController controller, string filename) { this.controller = controller; this.filename = filename; InitializeComponent(); this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon()); LogViewerConfig config = controller.GetConfigurationCopy().logViewer; if (config == null) { config = new LogViewerConfig(); } topMostTrigger = config.topMost; wrapTextTrigger = config.wrapText; toolbarTrigger = config.toolbarShown; LogMessageTextBox.BackColor = config.GetBackgroundColor(); LogMessageTextBox.ForeColor = config.GetTextColor(); LogMessageTextBox.Font = config.GetFont(); UpdateTexts(); }
public void SaveLogViewerConfig(LogViewerConfig newConfig) { _config.logViewer = newConfig; Configuration.Save(_config); }