System.Globalization.NumberFormatInfo.Clone Method

Creates a shallow copy of the System.Globalization.NumberFormatInfo object.

Syntax

public object Clone ()

Returns

A new object copied from the original System.Globalization.NumberFormatInfo object.

Remarks

The clone is writable even if the original System.Globalization.NumberFormatInfo object is read-only. Therefore, the properties of the clone can be modified with user-defined patterns.

A shallow copy of an object is a copy of the object only. If the object contains references to other objects, the shallow copy will not create copies of the referred objects. It will refer to the original objects instead. On the other hand, a deep copy of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object. In the case of a System.Globalization.NumberFormatInfo object, a shallow copy is sufficient for copying all instance properties, because all properties that return object references are static (Shared in Visual Basic).

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0