Freezable.FreezeCore(Boolean) 方法

定義

Freezable 物件設為不可修改的,或測試是否可以將它設為不可修改的。Makes the Freezable object unmodifiable or tests whether it can be made unmodifiable.

protected:
 virtual bool FreezeCore(bool isChecking);
protected virtual bool FreezeCore (bool isChecking);
abstract member FreezeCore : bool -> bool
override this.FreezeCore : bool -> bool
Protected Overridable Function FreezeCore (isChecking As Boolean) As Boolean

參數

isChecking
Boolean

true 表示傳回是否可以凍結物件 (而不是實際進行凍結),false 則表示實際凍結物件。true to return an indication of whether the object can be frozen (without actually freezing it); false to actually freeze the object.

傳回

Boolean

如果 isCheckingtrue,則這個方法會在可以將 Freezable 設為不可修改的時傳回 true,並在無法設為不可修改的時傳回 falseIf isChecking is true, this method returns true if the Freezable can be made unmodifiable, or false if it cannot be made unmodifiable. 如果 isCheckingfalse,則這個方法會在指定的 Freezable 現在為不可修改的時傳回 true,並在無法設為不可修改的時傳回 falseIf isChecking is false, this method returns true if the if the specified Freezable is now unmodifiable, or false if it cannot be made unmodifiable.

備註

請勿直接呼叫這個方法 (除非在實) 中呼叫基底時。Do not call this method directly (except when calling base in an implementation). 這個方法是由 CanFreeze 具有等於) 的屬性 (isChecking true ,以及 Freeze (isChecking 等於) 的方法 false 來內部呼叫。This method is called internally by the CanFreeze property (with isChecking equal to true) and the Freeze method (with isChecking equal to false).

給繼承者的注意事項

Freezable 當類別包含不是使用相依性屬性儲存的資料時,實作者必須覆寫這個方法。 Freezable implementers must override this method when the class contains data that is not stored using dependency properties.

一般的實作為呼叫基底,然後 Freeze(Freezable, Boolean) 針對該類別包含的所有具類型屬性呼叫靜態方法 Freezabletrue 但只有在為) 指定時,才會傳回所有屬性, (或可能已 true 凍結 isCheckingA typical implementation would call base, then call the static Freeze(Freezable, Boolean) method on all Freezable typed properties that the class contains, returning true only if all properties were frozen (or could have been frozen, in the case of specifying true for isChecking).

適用於

另請參閱