Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
         }
     }
 }