本文整理匯總了C#中System.Globalization.CultureInfo.IsFarsiCulture方法的典型用法代碼示例。如果您正苦於以下問題:C# CultureInfo.IsFarsiCulture方法的具體用法?C# CultureInfo.IsFarsiCulture怎麽用?C# CultureInfo.IsFarsiCulture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Globalization.CultureInfo
的用法示例。
在下文中一共展示了CultureInfo.IsFarsiCulture方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RegisterJQueryUILanguageFile
/// <summary>
/// Register the jQueryUI date picker language file.
/// </summary>
/// <param name="element">Control element to put in</param>
/// <param name="currentCulture">The current culture.</param>
public void RegisterJQueryUILanguageFile(Control element, CultureInfo currentCulture)
{
// If registered or told not to register, don't bother
if (this.PageElementExists("datepickerlang"))
{
return;
}
string jqueryUILangUrl;
// Check if override file is set ?
if (Config.JQueryUIOverrideLangFile.IsSet())
{
jqueryUILangUrl = !Config.JQueryUIOverrideLangFile.StartsWith("http")
&& !Config.JQueryUIOverrideLangFile.StartsWith("//")
? YafForumInfo.GetURLToScripts(Config.JQueryUIOverrideLangFile)
: Config.JQueryUIOverrideLangFile;
}
else
{
jqueryUILangUrl = YafContext.Current.Get<YafBoardSettings>().JqueryUICDNHosted
? "//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/i18n/jquery-ui-i18n.min.js"
#if DEBUG
: YafForumInfo.GetURLToScripts("jquery-ui-i18n.js");
#else
: YafForumInfo.GetURLToScripts("jquery-ui-i18n.min.js");
#endif
}
// load jQuery UI from google...
element.Controls.Add(ControlHelper.MakeJsIncludeControl(jqueryUILangUrl));
this.AddPageElement("datepickerlang");
if (currentCulture.IsFarsiCulture())
{
this.RegisterJsScriptsInclude("datepicker-farsi", "jquery.ui.datepicker-farsi.min.js");
}
}
示例2: GetCultureDayOfWeek
/// <summary>
/// Finds the corresponding DayOfWeek in specified culture
/// </summary>
/// <param name="day"></param>
/// <param name="culture"></param>
/// <returns></returns>
public static DayOfWeek GetCultureDayOfWeek(int day, CultureInfo culture)
{
if(culture.IsFarsiCulture())
{
return PersianDoW[day];
}
return GregorianDoW[day];
}