ServicedComponent.CanBePooled 方法
定义
在将对象放回到池中之前结构调用该方法。This method is called by the infrastructure before the object is put back into the pool. 重写此方法以决定是否将对象放回到池中。Override this method to vote on whether the object is put back into the pool.
protected public:
virtual bool CanBePooled();
protected internal virtual bool CanBePooled ();
abstract member CanBePooled : unit -> bool
override this.CanBePooled : unit -> bool
Protected Friend Overridable Function CanBePooled () As Boolean
返回
如果已维护的组件可被放入池中,则为 true;否则为 false。true if the serviced component can be pooled; otherwise, false.
示例
下面的代码示例演示如何使用此方法。The following code example demonstrates the use of this method.
// This object can be pooled.
virtual bool CanBePooled() override
{
return (true);
}
// This object can be pooled.
protected override bool CanBePooled()
{
return(true);
}
' This object can be pooled.
Protected Overrides Function CanBePooled() As Boolean
Return True
End Function 'CanBePooled