NumberFormatInfo.IsReadOnly Property


NumberFormatInfo 개체가 읽기 전용인지 나타내는 값을 가져옵니다.Gets a value that indicates whether this NumberFormatInfo object is read-only.

 property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean

Property Value


true가 읽기 전용인 경우 NumberFormatInfo이고, 그렇지 않으면 false입니다.true if the NumberFormatInfo is read-only; otherwise, false.


읽기 전용 속성에 대 한 할당을 수행 하려고 NumberFormatInfo 발생을 InvalidOperationException입니다.Attempting to perform an assignment to a property of a read-only NumberFormatInfo causes an InvalidOperationException.

호출할 수 있습니다 합니다 Clone 메서드는 읽기/쓰기를 NumberFormatInfo 다음 예제와 같이 읽기 전용 개체의 개체입니다.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)
      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