ObjectPoolingAttribute::Enabled Property
.NET Framework (current version)
Gets or sets a value that indicates whether object pooling is enabled.
Assembly: System.EnterpriseServices (in System.EnterpriseServices.dll)
Property Value
Type: System::Booleantrue if object pooling is enabled; otherwise, false. The default is true.
The following code example gets and sets the value of an ObjectPoolingAttribute's Enabled property.
[ObjectPooling(false)] public ref class ObjectPoolingAttributeEnabled : public ServicedComponent { public: void EnabledExample() { // Get the ObjectPoolingAttribute applied to the class. ObjectPoolingAttribute^ attribute = (ObjectPoolingAttribute^)Attribute::GetCustomAttribute( this->GetType(), ObjectPoolingAttribute::typeid, false); // Display the current value of the attribute's Enabled property. Console::WriteLine("ObjectPoolingAttribute.Enabled: {0}", attribute->Enabled); // Set the Enabled property value of the attribute. attribute->Enabled = true; // Display the new value of the attribute's Enabled property. Console::WriteLine("ObjectPoolingAttribute.Enabled: {0}", attribute->Enabled); } };
.NET Framework
Available since 1.1
Available since 1.1
Show: