当前位置: 首页>>代码示例>>C#>>正文


C# CultureInfo.GetHashCode方法代码示例

本文整理汇总了C#中System.Globalization.CultureInfo.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# CultureInfo.GetHashCode方法的具体用法?C# CultureInfo.GetHashCode怎么用?C# CultureInfo.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Globalization.CultureInfo的用法示例。


在下文中一共展示了CultureInfo.GetHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PosTest2

        public void PosTest2()
        {
            CultureInfo myCultureInfo = new CultureInfo("en");

            // the only guarantee that can be made about HashCodes is that they will be the same across calls
            int actualValue = myCultureInfo.GetHashCode();
            int expectedValue = myCultureInfo.GetHashCode();
            Assert.Equal(actualValue, expectedValue);
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:CultureInfoGetHashCode.cs

示例2: TestFrFRGetHashCode

        public void TestFrFRGetHashCode()
        {
            TextInfo textInfoFrance = new CultureInfo("fr-FR").TextInfo;
            TextInfo textInfoUS = new CultureInfo("en-US").TextInfo;

            int franceHashCode = textInfoFrance.GetHashCode();
            int usHashCode = textInfoUS.GetHashCode();
            Assert.False(franceHashCode == usHashCode);
        }
开发者ID:jmhardison,项目名称:corefx,代码行数:9,代码来源:TextInfoGetHashCode.cs

示例3: CultureAndRegionInfoBuilder

	public CultureAndRegionInfoBuilder(CultureInfo templateCulture,
									   Object templateRegion,
									   String language, String region,
									   String suffix, CulturePrefix prefix)
#endif
			{
				if(templateCulture == null)
				{
					throw new ArgumentNullException("templateCulture");
				}
				if(templateRegion == null)
				{
					throw new ArgumentNullException("templateRegion");
				}

				// Copy the original property values out of the templates.
				availableCalendars = templateCulture.OptionalCalendars;
				consoleFallbackUICulture = templateCulture;
				cultureName = templateCulture.Name;
				dateTimeFormat = templateCulture.DateTimeFormat;
				isNeutralCulture = templateCulture.IsNeutralCulture;
			#if CONFIG_REFLECTION
				lcid = templateCulture.LCID;
			#else
				lcid = templateCulture.GetHashCode();
			#endif
				numberFormat = templateCulture.NumberFormat;
				parent = templateCulture.Parent;
				textInfo = templateCulture.TextInfo;
			#if CONFIG_FRAMEWORK_1_2
				keyboardLayoutID = templateCulture.KeyboardLayoutID;
				//lineOrientation = templateCulture.LineOrientation; // TODO
			#endif
			#if CONFIG_REFLECTION
				cultureEnglishName = templateCulture.EnglishName;
				cultureNativeName = templateCulture.NativeName;
				threeLetterISOLanguageName =
					templateCulture.ThreeLetterISOLanguageName;
				threeLetterWindowsLanguageName =
					templateCulture.ThreeLetterWindowsLanguageName;
				twoLetterISOLanguageName =
					templateCulture.TwoLetterISOLanguageName;
			#endif
			#if !ECMA_COMPAT
			#if CONFIG_FRAMEWORK_2_0
				geoId = templateRegion.GeoId;
			#else
				geoId = templateRegion.GetHashCode();
			#endif
			#if CONFIG_FRAMEWORK_2_0
				currencyEnglishName = templateRegion.CurrencyEnglishName;
				currencyNativeName = templateRegion.CurrencyNativeName;
			#endif
				currencySymbol = templateRegion.CurrencySymbol;
				isMetric = templateRegion.IsMetric;
				isoCurrencySymbol = templateRegion.ISOCurrencySymbol;
				regionEnglishName = templateRegion.EnglishName;
				regionName = templateRegion.Name;
				regionNativeName = templateRegion.DisplayName;
				threeLetterISORegionName =
					templateRegion.ThreeLetterISORegionName;
				threeLetterWindowsRegionName =
					templateRegion.ThreeLetterWindowsRegionName;
				twoLetterISORegionName =
					templateRegion.TwoLetterISORegionName;
			#endif

				// Override the names if necessary.
				String prefixValue;
				if(prefix == CulturePrefix.IANA)
				{
					prefixValue = "i-";
				}
				else if(prefix == CulturePrefix.PrivateUse)
				{
					prefixValue = "x-";
				}
				else
				{
					prefixValue = "";
				}
				if(language == null || language.Length == 0)
				{
					language = cultureName;
				}
				cultureName = prefixValue + language + suffix;
			#if CONFIG_REFLECTION
				cultureEnglishName = cultureName;
				cultureNativeName = cultureName;
			#endif
			#if !ECMA_COMPAT
				if(region == null || region.Length == 0)
				{
					region = regionName;
				}
				regionName = prefixValue + region + suffix;
				regionEnglishName = regionName;
				regionNativeName = regionName;
			#endif
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:100,代码来源:sysglobl.cs


注:本文中的System.Globalization.CultureInfo.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。