本文整理汇总了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];
}