本文整理汇总了C#中CultureInfo.GetConsoleFallbackUICulture方法的典型用法代码示例。如果您正苦于以下问题:C# CultureInfo.GetConsoleFallbackUICulture方法的具体用法?C# CultureInfo.GetConsoleFallbackUICulture怎么用?C# CultureInfo.GetConsoleFallbackUICulture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CultureInfo
的用法示例。
在下文中一共展示了CultureInfo.GetConsoleFallbackUICulture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LcidTest
public void LcidTest(string cultureName, int lcid, string specificCultureName, string threeLetterISOLanguageName, string threeLetterWindowsLanguageName, string alternativeCultureName, string consoleUICultureName)
{
CultureInfo ci = new CultureInfo(lcid);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.True(ci.UseUserOverride, "UseUserOverride for lcid created culture expected to be true");
Assert.False(ci.IsReadOnly, "IsReadOnly for lcid created culture expected to be false");
Assert.Equal(threeLetterISOLanguageName, ci.ThreeLetterISOLanguageName);
Assert.Equal(threeLetterWindowsLanguageName, ci.ThreeLetterWindowsLanguageName);
ci = new CultureInfo(cultureName);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.True(ci.UseUserOverride, "UseUserOverride for named created culture expected to be true");
Assert.False(ci.IsReadOnly, "IsReadOnly for named created culture expected to be false");
ci = new CultureInfo(lcid, false);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.False(ci.UseUserOverride, "UseUserOverride with false user override culture expected to be false");
Assert.False(ci.IsReadOnly, "IsReadOnly with false user override culture expected to be false");
ci = CultureInfo.GetCultureInfo(lcid);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.False(ci.UseUserOverride, "UseUserOverride with Culture created by GetCultureInfo and lcid expected to be false");
Assert.True(ci.IsReadOnly, "IsReadOnly with Culture created by GetCultureInfo and lcid expected to be true");
ci = CultureInfo.GetCultureInfo(cultureName);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.False(ci.UseUserOverride, "UseUserOverride with Culture created by GetCultureInfo and name expected to be false");
Assert.True(ci.IsReadOnly, "IsReadOnly with Culture created by GetCultureInfo and name expected to be true");
ci = CultureInfo.GetCultureInfo(cultureName, "");
Assert.Equal(cultureName, ci.Name);
Assert.Equal(lcid, ci.LCID);
Assert.False(ci.UseUserOverride, "UseUserOverride with Culture created by GetCultureInfo and sort name expected to be false");
Assert.True(ci.IsReadOnly, "IsReadOnly with Culture created by GetCultureInfo and sort name expected to be true");
Assert.Equal(CultureInfo.InvariantCulture.TextInfo, ci.TextInfo);
Assert.Equal(CultureInfo.InvariantCulture.CompareInfo, ci.CompareInfo);
ci = CultureInfo.CreateSpecificCulture(cultureName);
Assert.Equal(specificCultureName, ci.Name);
ci = CultureInfo.GetCultureInfoByIetfLanguageTag(cultureName);
Assert.Equal(cultureName, ci.Name);
Assert.Equal(ci.Name, ci.IetfLanguageTag);
Assert.Equal(lcid, ci.KeyboardLayoutId);
Assert.Equal(consoleUICultureName, ci.GetConsoleFallbackUICulture().Name);
}