System.Globalization.NumberFormatInfo.Clone C# (CSharp) Method

Clone() public method

public Clone ( ) : object
return object
		public object Clone () 
		{
			NumberFormatInfo clone = (NumberFormatInfo) MemberwiseClone();
			// clone is not read only
			clone.isReadOnly = false;
			return clone;
		}

Usage Example

        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";
        }
All Usage Examples Of System.Globalization.NumberFormatInfo::Clone