NumberFormatInfo.IsReadOnly Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether this NumberFormatInfo object is read-only.
public:
property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean
Property Value
true
if the NumberFormatInfo is read-only; otherwise, false
.
Remarks
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
Imports System.Globalization
Module Example
Public Sub Main()
Dim nfi As NumberFormatInfo = NumberFormatInfo.CurrentInfo
Console.WriteLine("Read-Only: {0}", nfi.IsReadOnly)
Console.WriteLine()
Dim nfiw As NumberFormatInfo = CType(nfi.Clone(), NumberFormatInfo)
Console.WriteLine("Read-Only: {0}", nfiw.IsReadOnly)
End Sub
End Module
' The example displays the following output:
' Read-Only: True
'
' Read-Only: False
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET