語言

ServicedComponent.CanBePooled 方法

定義

此方法由基礎設施在物件重新放入池中前呼叫。 覆寫此方法,投票決定該物品是否放回池中。

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

適用於