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

Definición

Obtiene un valor que indica si este objeto NumberFormatInfo es de solo lectura.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

Valor de propiedad

Es true si la interfaz NumberFormatInfo es de solo lectura; de lo contrario, es false.true if the NumberFormatInfo is read-only; otherwise, false.

Comentarios

Al intentar realizar una asignación a una propiedad de solo NumberFormatInfo lectura, se produce una. InvalidOperationExceptionAttempting to perform an assignment to a property of a read-only NumberFormatInfo causes an InvalidOperationException.

Puede llamar Clone al método para crear un objeto de lectura/ NumberFormatInfo escritura a partir de un objeto de solo lectura, como se muestra en el ejemplo siguiente.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

Se aplica a

Consulte también: