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


C# NumberFormatInfo.Clone方法代码示例

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


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

示例1: TestClone

 public void TestClone()
 {
     NumberFormatInfo nfi1 = new NumberFormatInfo();
     nfi1.CurrencyDecimalSeparator = "testStr";
     NumberFormatInfo nfi2 = (NumberFormatInfo)nfi1.Clone();
     Assert.NotEqual(nfi1.GetHashCode(), nfi2.GetHashCode());
     Assert.NotEqual(nfi1, nfi2);
     Assert.Equal(nfi1.CurrencyDecimalDigits, nfi2.CurrencyDecimalDigits);
     Assert.Equal(nfi1.CurrencyDecimalSeparator, nfi2.CurrencyDecimalSeparator);
     Assert.Equal(nfi1.CurrencyGroupSizes, nfi2.CurrencyGroupSizes);
     Assert.Equal(nfi1.CurrencyGroupSeparator, nfi2.CurrencyGroupSeparator);
     Assert.Equal(nfi1.CurrencyNegativePattern, nfi2.CurrencyNegativePattern);
     Assert.Equal(nfi1.CurrencyPositivePattern, nfi2.CurrencyPositivePattern);
     Assert.Equal(nfi1.IsReadOnly, nfi2.IsReadOnly);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:15,代码来源:NumberFormatInfoClone.cs

示例2: ConstructInvariant

		private void ConstructInvariant (bool read_only)
		{
			cultureID = InvariantCultureId;

			/* NumberFormatInfo defaults to the invariant data */
			numInfo=NumberFormatInfo.InvariantInfo;

			if (!read_only) {
				numInfo = (NumberFormatInfo) numInfo.Clone ();
			}

			textInfo = CreateTextInfo (read_only);

			m_name=String.Empty;
			englishname=
			nativename="Invariant Language (Invariant Country)";
			iso3lang="IVL";
			iso2lang="iv";
			win3lang="IVL";
			default_calendar_type = 1 << CalendarTypeBits | (int) GregorianCalendarTypes.Localized;
		}
开发者ID:shana,项目名称:mono,代码行数:21,代码来源:CultureInfo.cs

示例3: ReadOnly

		public static NumberFormatInfo ReadOnly (NumberFormatInfo nfi)
		{
			NumberFormatInfo copy = (NumberFormatInfo)nfi.Clone();
			copy.isReadOnly = true;
			return copy;
		}			
开发者ID:shana,项目名称:mono,代码行数:6,代码来源:NumberFormatInfo.cs

示例4: ReadOnly

	// Convert a number format info object into a read-only version.
	public static NumberFormatInfo ReadOnly(NumberFormatInfo nfi)
			{
				if(nfi == null)
				{
					throw new ArgumentNullException("nfi");
				}
				else if(nfi.IsReadOnly)
				{
					return nfi;
				}
				else
				{
					NumberFormatInfo newNfi = (NumberFormatInfo)(nfi.Clone());
					newNfi.readOnly = true;
					return newNfi;
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:18,代码来源:NumberFormatInfo.cs

示例5: ConstructInvariant

		private void ConstructInvariant (bool read_only)
		{
			cultureID = InvariantCultureId;

			/* NumberFormatInfo defaults to the invariant data */
			numInfo=NumberFormatInfo.InvariantInfo;
			/* DateTimeFormatInfo defaults to the invariant data */
			dateTimeInfo=DateTimeFormatInfo.InvariantInfo;

			if (!read_only) {
				numInfo = (NumberFormatInfo) numInfo.Clone ();
				dateTimeInfo = (DateTimeFormatInfo) dateTimeInfo.Clone ();
			}

			textInfo = CreateTextInfo (read_only);

			m_name=String.Empty;
			displayname=
			englishname=
			nativename="Invariant Language (Invariant Country)";
			iso3lang="IVL";
			iso2lang="iv";
			icu_name="en_US_POSIX";
			win3lang="IVL";
		}
开发者ID:nestalk,项目名称:mono,代码行数:25,代码来源:CultureInfo.cs


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