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)

Syntax

'Declaration
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)
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