Partilhar via


SPVirtualServerConfig.EventHandlersEnabled Property

NOTE: This API is now obsolete.

Gets or sets a Boolean value that specifies whether event handlers for document libraries are enabled.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("Use V3 style events")> _
Public Property EventHandlersEnabled As Boolean
    Get
    Set
'Usage
Dim instance As SPVirtualServerConfig
Dim value As Boolean

value = instance.EventHandlersEnabled

instance.EventHandlersEnabled = value
[ObsoleteAttribute("Use V3 style events")]
public bool EventHandlersEnabled { get; set; }

Property Value

Type: System.Boolean
true if event handlers are enabled; otherwise, false.

Remarks

Setting the value of the EventHandlersEnabled property requires calling Update to commit the property changes to the database.

For information about how to use document library events, see Walkthrough: Handling Document Library Events.

Examples

The following code example enables event handlers for document libraries on the specified virtual server.

Dim globalAdmin As New SPGlobalAdmin()

Dim uri As New System.Uri("http://Server_Name")
Dim vServer As SPVirtualServer = globalAdmin.OpenVirtualServer(uri)

Dim vConfig As SPVirtualServerConfig = vServer.Config
vConfig.EventHandlersEnabled = True

vConfig.Properties.Update()

globalAdmin.Close()
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();

System.Uri uri = new System.Uri("http://Server_Name");
SPVirtualServer vServer = globalAdmin.OpenVirtualServer(uri);

SPVirtualServerConfig vConfig = vServer.Config;
vConfig.EventHandlersEnabled = true;

vConfig.Properties.Update();

globalAdmin.Close();

See Also

Reference

SPVirtualServerConfig Class

SPVirtualServerConfig Members

Microsoft.SharePoint.Administration Namespace