private void FillLanguageDropdown()
 {
     if (!base.IsPostBack)
     {
         LanguageList           langList = new LanguageList();
         PropertiesContentPanel propertiesContentPanel = (PropertiesContentPanel)this.DataClassificationLanguage.Controls[0];
         DropDownList           dropDownList           = (DropDownList)propertiesContentPanel.FindControl("ddLanguage");
         HashSet <int>          expectedCultureLcids   = LanguagePackInfo.expectedCultureLcids;
         IEnumerable <ListItem> source = expectedCultureLcids.Select(delegate(int lcid)
         {
             CultureInfo cultureInfo = new CultureInfo(lcid);
             return(new ListItem(RtlUtil.ConvertToDecodedBidiString(langList.GetDisplayValue(cultureInfo.Name), RtlUtil.IsRtl), cultureInfo.Name));
         });
         dropDownList.Items.AddRange((from i in source
                                      orderby i.Text
                                      select i).ToArray <ListItem>());
     }
 }
Exemplo n.º 2
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!base.IsPostBack)
     {
         LanguageList           langList = new LanguageList();
         PropertiesContentPanel propertiesContentPanel = (PropertiesContentPanel)this.outlooksettings.Controls[0];
         DropDownList           dropDownList           = (DropDownList)propertiesContentPanel.FindControl("ddLocale");
         HashSet <int>          expectedCultureLcids   = LanguagePackInfo.expectedCultureLcids;
         IEnumerable <ListItem> source = expectedCultureLcids.Select(delegate(int lcid)
         {
             CultureInfo cultureInfo = new CultureInfo(lcid);
             return(new ListItem(RtlUtil.ConvertToDecodedBidiString(langList.GetDisplayValue(cultureInfo.Name), RtlUtil.IsRtl), cultureInfo.Name));
         });
         dropDownList.Items.AddRange((from i in source
                                      orderby i.Text
                                      select i).ToArray <ListItem>());
     }
 }