ServicedComponent.CanBePooled 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在对象放回池之前,基础结构会调用此方法。 重写此方法以投票决定是否将对象放回池中。
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.
示例
下面的代码示例演示如何使用此方法。
// 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