ServicedComponent.CanBePooled 方法

在将对象放回到池中之前结构调用该方法。重写此方法以决定是否将对象放回到池中。

**命名空间:**System.EnterpriseServices
**程序集:**System.EnterpriseServices(在 system.enterpriseservices.dll 中)

语法

声明
Protected Friend Overridable Function CanBePooled As Boolean
用法
Dim returnValue As Boolean

returnValue = Me.CanBePooled
protected internal virtual bool CanBePooled ()
protected public:
virtual bool CanBePooled ()
protected boolean CanBePooled ()
protected internal function CanBePooled () : boolean

返回值

如果已维护的组件可被放入池中,则为 true;否则为 false

示例

下面的代码示例演示如何使用此方法。

' This object can be pooled.
Protected Overrides Function CanBePooled() As Boolean 
    Return True

End Function 'CanBePooled
// This object can be pooled.
protected override bool CanBePooled()
{
    return(true);
}
// This object can be pooled.
virtual bool CanBePooled() override
{
   return (true);
}
// This object can be pooled.
protected boolean CanBePooled()
{
    return true;
} //CanBePooled

.NET Framework 安全性

  • 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见。

平台

Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

ServicedComponent 类
ServicedComponent 成员
System.EnterpriseServices 命名空间