Partilhar via


SPEventReceiverDefinitionCollection.Add Method (SPEventReceiverType, String, String)

Adds an event receiver definition to the collection that is already associated with its Assembly name, Class name, and event receiver type.

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

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)> _
Public Sub Add ( _
    receiverType As SPEventReceiverType, _
    assembly As String, _
    className As String _
)
'Usage
Dim instance As SPEventReceiverDefinitionCollection
Dim receiverType As SPEventReceiverType
Dim assembly As String
Dim className As String

instance.Add(receiverType, assembly, className)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)]
public void Add(
    SPEventReceiverType receiverType,
    string assembly,
    string className
)

Parameters

  • assembly
    Type: System.String

    A string that contains the name of the assembly.

  • className
    Type: System.String

    A string that contains the name of the class.

Remarks

This overload of the Add method adds the new object to the in-memory collection of event receiver definitions, in addition to adding the item to the backing store when the Update method is called on the item.

See Also

Reference

SPEventReceiverDefinitionCollection Class

SPEventReceiverDefinitionCollection Members

Add Overload

Microsoft.SharePoint Namespace

FireContextEvent(SPSite)

SPEventReceiverType