private void Settings_Load(object sender, EventArgs e) { locked = true; string[] colors = Enum.GetNames(typeof(JColorStyle)); sThemeColor.Items.Clear(); foreach (string str in colors) { if (!str.Equals("Default") && !str.Equals("Custom")) { sThemeColor.Items.Add(str.Replace("_", " ")); } } color = PreferenceManager.Database.ThemeColor; theme = PreferenceManager.Database.Theme; sThemeColor.SelectedItem = color.ToString(); jTheme.SelectedItem = theme.ToString(); jColorSize.SelectedIndex = PreferenceManager.Database.ColorSize; string[] keys = Enum.GetNames(typeof(Keys)); KeyCaptureCombo.Items.Clear(); KeyCopyToClipboard.Items.Clear(); foreach (string str in keys) { KeyCaptureCombo.Items.Add(str); KeyCopyToClipboard.Items.Add(str); } string[] keysmid = Enum.GetNames(typeof(JKeyModifiers)); KeyModCaptureCombo.Items.Clear(); KeyModCopyToClipboard.Items.Clear(); foreach (string str in keysmid) { KeyModCaptureCombo.Items.Add(str); KeyModCopyToClipboard.Items.Add(str); } KeyModCaptureCombo.SelectedIndex = KeyCodeConverter.GetAltIndex(PreferenceManager.Database.ScreenCopyColorKeyModifier); KeyModCopyToClipboard.SelectedIndex = KeyCodeConverter.GetAltIndex(PreferenceManager.Database.CopyToClipboardKeyModifier); KeyCaptureCombo.SelectedIndex = KeyCodeConverter.GetIndex(PreferenceManager.Database.ScreenCopyColorKey); KeyCopyToClipboard.SelectedIndex = KeyCodeConverter.GetIndex(PreferenceManager.Database.CopyToClipboardKey); ClipboardFormatingTypeCombo.SelectedIndex = PreferenceManager.Database.ClipboardFormatingType; FormatingTextBox.Text = PreferenceManager.Database.FormatTemplate; FormatingTextBox.Visible = ClipboardFormatingTypeCombo.SelectedIndex == 5; ToggleAutoCopyToClipboard.Checked = PreferenceManager.Database.AutoCopyToClipboard; StayOnTop.Checked = PreferenceManager.Database.StayOnTop; locked = false; }
public override void Serialize(DataWriter writer) { writer.Write(KeyCodeConverter.GetAltIndex(ScreenCopyColorKeyModifier)); writer.Write(KeyCodeConverter.GetIndex(ScreenCopyColorKey)); writer.Write(KeyCodeConverter.GetIndex(CopyToClipboardKey)); writer.Write(KeyCodeConverter.GetAltIndex(CopyToClipboardKeyModifier)); writer.Write(ColorSize); writer.Write((int)ThemeColor); writer.Write((int)Theme); writer.Write(FirstTime); writer.Write(AutoCopyToClipboard); writer.Write(StayOnTop); writer.Write(ClipboardFormatingType); writer.Write(FormatTemplate); }