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)


Public Sub Add ( _
    receiverType As SPEventReceiverType, _
    assembly As String, _
    className As String _
Dim instance As SPEventReceiverDefinitionCollection
Dim receiverType As SPEventReceiverType
Dim assembly As String
Dim className As String

instance.Add(receiverType, assembly, className)
public void Add(
    SPEventReceiverType receiverType,
    string assembly,
    string className


  • 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.


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


SPEventReceiverDefinitionCollection class

SPEventReceiverDefinitionCollection members

Add overload

Microsoft.SharePoint namespace