Array.IsReadOnly Propriedade
Definição
public:
property bool IsReadOnly { bool get(); };
public:
virtual property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
public virtual bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean
Public Overridable ReadOnly Property IsReadOnly As Boolean
Valor da propriedade
Esta propriedade é sempre false para todas as matrizes.This property is always false for all arrays.
Implementações
Comentários
Array implementa a IsReadOnly propriedade porque ela é exigida pela System.Collections.IList interface.Array implements the IsReadOnly property because it is required by the System.Collections.IList interface. Uma matriz que é somente leitura não permite a adição, remoção ou modificação de elementos depois que a matriz é criada.An array that is read-only does not allow the addition, removal, or modification of elements after the array is created.
Se você precisar de uma coleção somente leitura, use uma System.Collections classe que implemente a System.Collections.IList interface.If you require a read-only collection, use a System.Collections class that implements the System.Collections.IList interface.
Caso você converta ou Converta uma matriz em um IList objeto de interface, a IList.IsReadOnly propriedade retornará false .If you cast or convert an array to an IList interface object, the IList.IsReadOnly property returns false. No entanto, se você converte ou converte uma matriz em uma IList<T> interface, a IsReadOnly propriedade retorna true .However, if you cast or convert an array to a IList<T> interface, the IsReadOnly property returns true.
A recuperação do valor dessa propriedade é uma operação O(1).Retrieving the value of this property is an O(1) operation.