Freezable.FreezeCore(Boolean) Freezable.FreezeCore(Boolean) Freezable.FreezeCore(Boolean) Freezable.FreezeCore(Boolean) Method

定义

使 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 Boolean Boolean 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.

注解

请勿调用此方法,直接 (但调用基实现中)。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)方法对所有Freezable类型的类包含,返回的属性true仅当所有属性都被冻结 (或可能已被冻结,在指定的情况下trueisChecking)。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).

适用于

另请参阅