共用方式為


SPEventReceiverDefinitionCollection.Add Method

Creates an event receiver definition in the collection.

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

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)> _
Public Function Add As SPEventReceiverDefinition
'Usage
Dim instance As SPEventReceiverDefinitionCollection
Dim returnValue As SPEventReceiverDefinition

returnValue = instance.Add()
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)]
public SPEventReceiverDefinition Add()

Return Value

Type: Microsoft.SharePoint.SPEventReceiverDefinition
An SPEventReceiverDefinition object that represents the event receiver definition.

Remarks

The event receiver added to the collection by this method has an EmptyGuid and no SPList.

See Also

Reference

SPEventReceiverDefinitionCollection Class

SPEventReceiverDefinitionCollection Members

Add Overload

Microsoft.SharePoint Namespace

Other Resources

Creating a Basic Event Handler