共用方式為


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

傳回

如果 Serviced 元件可以共用,則為 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

適用於