public static void BuildLanguageList(DataRow inputRow, DataTable dataTable, DataObjectStore store) { LanguageList lang = new LanguageList(); dataTable.BeginLoadData(); Array.ForEach <string>(HygieneUtils.antispamFilterableLanguages, delegate(string code) { string text = code.ToUpper().ToString(); DataRow dataRow = dataTable.NewRow(); try { dataRow["LanguageCode"] = text; dataRow["LanguageName"] = RtlUtil.ConvertToDecodedBidiString(lang.GetDisplayValue(code), RtlUtil.IsRtl); dataRow["Identity"] = new Identity(text, dataRow["LanguageName"].ToString()); } catch { dataRow["LanguageCode"] = text; dataRow["LanguageName"] = text; dataRow["Identity"] = new Identity(text, text); } dataTable.Rows.Add(dataRow); }); dataTable.EndLoadData(); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (!base.DesignMode) { ScriptManager.GetCurrent(this.Page).RegisterScriptControl <MessageTraceExSlab>(this); } if (base.FieldValidationAssistantExtender != null) { this.searchParamsFvaCanvas = (HtmlGenericControl)this.dockpanel.FindControl("searchParamsFvaCanvas"); base.FieldValidationAssistantExtender.TargetControlID = this.searchParamsFvaCanvas.UniqueID; } ExTimeZone exTimeZone = ExTimeZone.UtcTimeZone; if (RbacPrincipal.Current.UserTimeZone != null) { exTimeZone = RbacPrincipal.Current.UserTimeZone; } else if (!ExTimeZoneEnumerator.Instance.TryGetTimeZoneByName("UTC", out exTimeZone)) { exTimeZone = ExTimeZone.UtcTimeZone; } foreach (ExTimeZone exTimeZone2 in ExTimeZoneEnumerator.Instance) { string text = RtlUtil.ConvertToDecodedBidiString(exTimeZone2.LocalizableDisplayName.ToString(CultureInfo.CurrentCulture), RtlUtil.IsRtl); this.ddTimeZone.Items.Add(new ListItem(text, exTimeZone2.Id) { Selected = (exTimeZone.Id == exTimeZone2.Id) }); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); foreach (ExTimeZone exTimeZone in ExTimeZoneEnumerator.Instance) { string text = RtlUtil.ConvertToDecodedBidiString(exTimeZone.LocalizableDisplayName.ToString(CultureInfo.CurrentCulture), RtlUtil.IsRtl); this.ddlTimeZone.Items.Add(new ListItem(text, exTimeZone.Id)); } }
protected void Page_Load(object sender, EventArgs e) { bool isRtl = RtlUtil.IsRtl; for (int i = 0; i < RegionalSettingsSlab.supportedLanguages.Count; i++) { this.ddlLanguage.Items.Add(new ListItem(RtlUtil.ConvertToDecodedBidiString(RegionalSettingsSlab.supportedLanguages.GetKey(i).ToString(), isRtl), RegionalSettingsSlab.supportedLanguages.GetByIndex(i).ToString())); } foreach (ExTimeZone exTimeZone in ExTimeZoneEnumerator.Instance) { string text = RtlUtil.ConvertToDecodedBidiString(exTimeZone.LocalizableDisplayName.ToString(CultureInfo.CurrentCulture), isRtl); this.ddlTimeZone.Items.Add(new ListItem(text, exTimeZone.Id)); } }
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>()); } }
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>()); } }
public static void PopulateRetentionTypes(DropDownList ddlRetentionType) { Type typeFromHandle = typeof(ElcFolderType); foreach (object obj in Enum.GetValues(typeFromHandle)) { ElcFolderType elcFolderType = (ElcFolderType)obj; if (elcFolderType != ElcFolderType.ManagedCustomFolder && elcFolderType != ElcFolderType.NonIpmRoot && elcFolderType != ElcFolderType.LegacyArchiveJournals && elcFolderType != ElcFolderType.All && elcFolderType != ElcFolderType.Personal && elcFolderType != ElcFolderType.RecoverableItems && elcFolderType != ElcFolderType.Contacts && elcFolderType != ElcFolderType.Tasks) { string value = LocalizedDescriptionAttribute.FromEnum(typeFromHandle, elcFolderType); string text = elcFolderType.ToString(); ListItem item = new ListItem(RtlUtil.ConvertToDecodedBidiString(value, RtlUtil.IsRtl), text); ddlRetentionType.Items.Add(item); if (elcFolderType == ElcFolderType.Inbox) { ddlRetentionType.SelectedValue = text; } } } }
private static string GetRegionDisplayName(string countryCode) { string result; try { CountryInfo countryInfo = CountryInfo.Parse(countryCode); result = RtlUtil.ConvertToDecodedBidiString(Strings.GetLocalizedString((Strings.IDs)Enum.Parse(typeof(Strings.IDs), countryInfo.UniqueId)), RtlUtil.IsRtl); } catch { try { result = RtlUtil.ConvertToDecodedBidiString(Strings.GetLocalizedString((Strings.IDs)Enum.Parse(typeof(Strings.IDs), string.Format("Region_{0}", countryCode))), RtlUtil.IsRtl); } catch { result = countryCode; } } return(result); }
public static void GetContentFilterPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { if (dataTable.Rows.Count == 0) { return; } DataRow row = dataTable.Rows[0]; Antispam.contentEmailListParameters.ForEach(delegate(string p) { if (!row[p].IsNullValue()) { MultiValuedProperty <SmtpAddress> multiValuedProperty = (MultiValuedProperty <SmtpAddress>)row[p]; row[string.Format("str{0}", p)] = multiValuedProperty.ToStringArray <SmtpAddress>().StringArrayJoin("; "); } }); List <Identity> list = new List <Identity>(); List <Identity> list2 = new List <Identity>(); LanguageList languageList = new LanguageList(); if (!row["RegionBlockList"].IsNullValue()) { foreach (string text in ((MultiValuedProperty <string>)row["RegionBlockList"])) { list.Add(new Identity(text.ToString(), Antispam.GetRegionDisplayName(text))); } row["regionList"] = list.ToArray(); } if (!row["LanguageBlockList"].IsNullValue()) { foreach (string text2 in ((MultiValuedProperty <string>)row["LanguageBlockList"])) { list2.Add(new Identity(text2.ToString(), RtlUtil.ConvertToDecodedBidiString(languageList.GetDisplayValue(text2), RtlUtil.IsRtl))); } row["languageList"] = list2.ToArray(); } }
public static void PopulateRetentionActions(RadioButtonList rblRetentionAction, bool includeArchive) { RetentionActionType[] array = new RetentionActionType[] { RetentionActionType.DeleteAndAllowRecovery, RetentionActionType.PermanentlyDelete, RetentionActionType.MoveToArchive }; foreach (RetentionActionType retentionActionType in array) { if (RetentionActionType.MoveToArchive != retentionActionType || includeArchive) { string value = string.Empty; switch (retentionActionType) { case RetentionActionType.DeleteAndAllowRecovery: value = Strings.RetentionActionEnumDeleteAndAllowRecovery; break; case RetentionActionType.PermanentlyDelete: value = Strings.RetentionActionEnumPermanentlyDelete; break; case RetentionActionType.MoveToArchive: value = Strings.RetentionActionEnumMoveToArchive; break; } string value2 = retentionActionType.ToString(); ListItem item = new ListItem(RtlUtil.ConvertToDecodedBidiString(value, RtlUtil.IsRtl), value2); rblRetentionAction.Items.Add(item); } } if (rblRetentionAction.Items.Count > 0) { rblRetentionAction.Items[0].Selected = true; } }
public static string GetCountryDisplayName(string locale) { if (string.IsNullOrEmpty(locale)) { return(string.Empty); } string result; try { LanguageList languageList = new LanguageList(); result = RtlUtil.ConvertToDecodedBidiString(languageList.GetDisplayValue(locale), RtlUtil.IsRtl); } catch (Exception exception) { DDIHelper.Trace("Failed to locate locale {0}, Error: {1}", new object[] { locale, exception.GetTraceFormatter() }); result = locale; } return(result); }
public static string ConvertToBidiString(string value) { return(RtlUtil.ConvertToDecodedBidiString(value, RtlUtil.IsRtl)); }
public static List <DropDownItemData> GetAvailableUmLanguages() { MultiValuedProperty <UMLanguage> multiValuedProperty = Utils.ComputeUnionOfUmServerLanguages(); List <DropDownItemData> list = new List <DropDownItemData>(multiValuedProperty.Count); bool isRtl = RtlUtil.IsRtl; list.AddRange(multiValuedProperty.ConvertAll((UMLanguage x) => new DropDownItemData(RtlUtil.ConvertToDecodedBidiString(x.Culture.NativeName, isRtl), x.Culture.LCID.ToString()))); return(list); }