共用方式為


SPEventReceiverDefinitionCollection.Add method (SPEventReceiverType, String, String)

事件接收器將定義加入至已經與它的Assembly名稱、 Class名稱和事件接收者型別相關聯的集合。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
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
)

參數

  • className
    Type: System.String

    字串,包含類別的名稱。

備註

Add方法的這個多載會將新的物件加入至記憶體中的事件接收器定義集合,除了項目上呼叫Update方法時,就將項目加入至支援存放區。

請參閱

參照

SPEventReceiverDefinitionCollection class

SPEventReceiverDefinitionCollection members

Add overload

Microsoft.SharePoint namespace

FireContextEvent(SPSite)

SPEventReceiverType