private void InitialApp() { DictionaryFile = AppInfoHelper.GetDictionaryFolder(); if (DictionaryFile == "") { } else { if (!Directory.Exists(DictionaryFile)) { try { Directory.CreateDirectory(DictionaryFile); } catch { } } else { dict = DictHelper.ReadDictList(); AppInfoHelper.UpdateDictList(); ClbDictSetting.Items.Clear(); ClbWordbookSetting.Items.Clear(); for (int i = 0; i < dictList.Count; i++) { ClbDictSetting.Items.Add(dictList[i]); if (AppInfoHelper.GetDictList().Contains(dictList[i])) { ClbDictSetting.SetItemChecked(i, true); } else { ClbDictSetting.SetItemChecked(i, false); } } for (int i = 0; i < wordbookList.Count; i++) { ClbWordbookSetting.Items.Add(wordbookList[i]); if (AppInfoHelper.GetDisorderList().Contains(wordbookList[i])) { ClbWordbookSetting.SetItemChecked(i, true); } else { ClbWordbookSetting.SetItemChecked(i, false); } } CTBDict.Value = DictionaryFile; } } }
private void ClbDictSetting_SelectedIndexChanged(object sender, EventArgs e) { for (int i = 0; i < dictList.Count; i++) { AppInfoHelper.AlterDictList(dictList[i], AppInfoHelper.Dict.isdict, Convert.ToString(ClbDictSetting.GetItemChecked(i))); } }