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.

傳回

如果 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.

備註

請勿直接呼叫這個方法(除非是在實作用中呼叫 base)。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.

典型的執行會呼叫 base,然後在類別所包含的所有 Freezable 具類型的屬性上呼叫靜態 Freeze(Freezable, Boolean) 方法,只有在所有屬性都已凍結(或在指定 true 以進行凍結時,才會傳回 true isChecking).A 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).

適用於

另請參閱