Array.IsReadOnly Propriété

Définition

Obtient une valeur indiquant si Array est en lecture seule.

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

Valeur de propriété

Boolean

Cette propriété est toujours false pour tous les tableaux.

Implémente

Remarques

Array implémente la IsReadOnly propriété, car elle est requise par l’interface System.Collections.IList . Un tableau en lecture seule n’autorise pas l’ajout, la suppression ou la modification d’éléments après la création du tableau.

Si vous avez besoin d’une collection en lecture seule, utilisez une System.Collections classe qui implémente l’interface System.Collections.IList .

Si vous effectuez un cast ou convertissez un tableau en objet d’interface IList , la IList.IsReadOnly propriété retourne false. Toutefois, si vous effectuez un cast ou convertissez un IList<T> tableau en interface, la IsReadOnly propriété retourne true.

La récupération de la valeur de cette propriété est une opération O(1).

S’applique à

Voir aussi