NumberFormatInfo.IsReadOnly NumberFormatInfo.IsReadOnly NumberFormatInfo.IsReadOnly NumberFormatInfo.IsReadOnly Property

정의

NumberFormatInfo 개체가 읽기 전용인지 나타내는 값을 가져옵니다.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

속성 값

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)
      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

적용 대상

추가 정보