void ReadToForm() { CB_AutoStartTransfer.Checked = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.AutoStartTransfer) == "1" ? true : false; CB_autologin.Checked = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.AutoLogin) == "1" ? true : false; CB_shutdown.Checked = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.ShutdownWhenDone) == "1" ? true : false; CBB_lang.Items.AddRange(GetList_UI_n_lang.GetListLangFile().ToArray()); langfilename = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.lang); CBB_lang.SelectedText = langfilename; CBB_ui.Items.AddRange(GetList_UI_n_lang.GetListUiFile().ToArray()); uifilename = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.UI_dll_file); CBB_ui.SelectedText = uifilename; decimal MaxGroupsDownload = 2; decimal MaxItemsInGroupDownload = 2; decimal BufferSize = 32; decimal GD_ChunksSize = 5; decimal Dropbox_ChunksSize = 25; Decimal.TryParse(Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.MaxGroupsDownload), out MaxGroupsDownload); Decimal.TryParse(Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.MaxItemsInGroupDownload), out MaxItemsInGroupDownload); Decimal.TryParse(Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.BufferSize), out BufferSize); Decimal.TryParse(Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.GD_ChunksSize), out GD_ChunksSize); Decimal.TryParse(Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.Dropbox_ChunksSize), out Dropbox_ChunksSize); try { NUD_group.Value = MaxGroupsDownload; } catch { } try { NUD_item.Value = MaxItemsInGroupDownload; } catch { } try { NUD_buffer.Value = BufferSize; } catch { } try { NUD_GDchunks.Value = GD_ChunksSize; } catch { } try { NUD_DBchunks.Value = Dropbox_ChunksSize; } catch { } }
private void MenuSetting_SubmenuOpened(object sender, RoutedEventArgs e) { uis = new ObservableCollection <ContextMenuDataModel>(); langs = new ObservableCollection <ContextMenuDataModel>(); string ui_default = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.UI_dll_file); string lang_default = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.lang); foreach (string s in GetList_UI_n_lang.GetListUiFile()) { uis.Add(new ContextMenuDataModel(s) { IsEnabled = s == ui_default ? false : true }); } foreach (string s in GetList_UI_n_lang.GetListLangFile()) { langs.Add(new ContextMenuDataModel(s) { IsEnabled = s == lang_default ? false : true }); } MenuChangeUI.ItemsSource = uis; MenuChangeLang.ItemsSource = langs; }
//load menu ui & lang private void settingsToolStripMenuItem_DropDownOpening(object sender, EventArgs e) { //ui uiToolStripMenuItem.DropDownItems.Clear(); string dll_now = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.UI_dll_file); foreach (string file in GetList_UI_n_lang.GetListUiFile()) { ToolStripMenuItem item = new ToolStripMenuItem(file); item.Size = new System.Drawing.Size(152, 22); if (dll_now == file) { item.Checked = true; item.Enabled = false; } else { item.Click += UI_Item_Click; } uiToolStripMenuItem.DropDownItems.Add(item); } //lang languageToolStripMenuItem.DropDownItems.Clear(); string lang_now = Setting_UI.reflection_eventtocore.SettingAndLanguage.GetSetting(SettingsKey.lang); foreach (string file in GetList_UI_n_lang.GetListLangFile()) { ToolStripMenuItem item = new ToolStripMenuItem(file); item.Size = new System.Drawing.Size(152, 22); if (lang_now == file) { item.Checked = true; item.Enabled = false; } else { item.Click += Lang_Item_Click; } languageToolStripMenuItem.DropDownItems.Add(item); } }//menu setting (ui & lang)