NumberFormatInfo.IsReadOnly Property
.NET Framework 4.5
Gets a value that indicates whether this NumberFormatInfo object is read-only.
Assembly: mscorlib (in mscorlib.dll)
Attempting to perform an assignment to a property of a read-only NumberFormatInfo causes an InvalidOperationException.
You can call the Clone method to create a read/write NumberFormatInfo object from a read-only object, as the following example illustrates.
using System; using System.Globalization; public class Example { public static void Main() { NumberFormatInfo nfi = NumberFormatInfo.CurrentInfo; Console.WriteLine("Read-Only: {0}\n", nfi.IsReadOnly); NumberFormatInfo nfiw = (NumberFormatInfo) nfi.Clone(); Console.WriteLine("Read-Only: {0}", nfiw.IsReadOnly); } } // The example displays the following output: // Read-Only: True // // Read-Only: False
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.