Пример #1
0
        private void FillList()
        {
            LanguageCodeItem unknownItem = new LanguageCodeItem("(Unspecified)", "unk");

            languageCodeList.Items.Add(unknownItem);
            for (int i = 0; i < ISO639Table.LanguageCodes.Length; i += 2)
            {
                LanguageCodeItem newItem = new LanguageCodeItem(ISO639Table.LanguageCodes[i + 1], ISO639Table.LanguageCodes[i]);
                languageCodeList.Items.Add(newItem);
            }
        }
Пример #2
0
        private void LanguageCodeList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (languageCodeList.SelectedItems.Count == 0)
            {
                selectedItem     = null;
                okButton.Enabled = false;
                return;
            }

            selectedItem     = (LanguageCodeItem)languageCodeList.SelectedItems[0];
            okButton.Enabled = true;
        }
Пример #3
0
 private void LocateLanguageCode(string languageCode)
 {
     for (int i = 0; i < languageCodeList.Items.Count; i++)
     {
         LanguageCodeItem item = (LanguageCodeItem)languageCodeList.Items[i];
         if (item.LanguageCode == languageCode)
         {
             languageCodeList.Focus();
             languageCodeList.SelectedIndices.Clear();
             languageCodeList.TopItem = item;
             item.Selected            = true;
             return;
         }
     }
 }