Freezable.IsFrozen Proprietà
Definizione
Ottiene un valore che indica se l'oggetto è attualmente modificabile.Gets a value that indicates whether the object is currently modifiable.
public:
property bool IsFrozen { bool get(); };
public bool IsFrozen { get; }
member this.IsFrozen : bool
Public ReadOnly Property IsFrozen As Boolean
Valore della proprietà
true
se l'oggetto è bloccato e non può essere modificato. false
se l'oggetto può essere modificato.true
if the object is frozen and cannot be modified; false
if the object can be modified.
Commenti
Tentativo di modificare un oggetto quando la relativa IsFrozen proprietà true
genera un'eccezione InvalidOperationException .Attempting to modify an object when its IsFrozen property is true
throws an InvalidOperationException.
Questa proprietà è di sola lettura dal punto di vista del modello a oggetti.This property is read-only from the object model perspective. Parte della documentazione relativa ai Freezable comportamenti può indicare "insiemi IsFrozen a true
" o un linguaggio simile quando si discute il comportamento di altri metodi di Freezable , ma questo comportamento si verifica internamente nelle istanze della classe, quando i metodi dell'istanza modificano le variabili private presenti all'interno della classe astratta.Some of the documentation about Freezable behaviors may mention "sets IsFrozen to true
" or similar language when discussing the behavior of other methods of Freezable, but this behavior is happening internally in the class instances, when methods of the instance manipulate the private variables that exist within the abstract class. Per impostare il valore di questa proprietà, è necessario chiamare Freeze .To set the value of this property, you should call Freeze. Si tratta in realtà di un'operazione eseguita una sola volta per modificare la IsFrozen proprietà dallo false
stato iniziale predefinito allo true
stato.This effectively is a one-time operation to change the IsFrozen property from the initial default false
state to the true
state. Non è disponibile alcun metodo per impostare di nuovo il valore false
.There is no available means to set the value back to false
. In alternativa, è possibile modificare qualsiasi copia completa eseguita dall'originale (vedere il Clone metodo).Instead, you could change any deep copy made from the original (see the Clone method). Questo si verifica in base alla progettazione ed è il comportamento di qualsiasi classe derivata quando viene applicata ai casi in cui il Freezable modello è utile.This is by design and is how any derived class should behave when applied to the cases where the Freezable pattern is useful.