开发者

how many event receivers we can use for one SharePoint Document Library?

i want to know how many event receivers can w开发者_Python百科e use for one SharePoint List or Document Library?


There shouldn't be a technical limit but you'd have to question your technical design if you required dozens and dozens of them.


We Can Inherit Receivers from SPListEventReceiver and SPItemEventReceiver.

Definition

Event Receivers have before and after events.

The events relating to a site are:

Before
    SiteDeleting
    WebDeleting
    WebMoving
After
    SiteDeleted
    WebDeleted
    WebMoved

A class needs to inherit from SPWebEventReceiver. The behaviour is defined by overriding a method for one of the above before or after events. You can access properties that relates to the event that the feature is listening using SPWebEventProperties.

The events relating to a list are:

Before
    FieldAdding
    FieldUpdating
    FieldDeleting
After
    FieldAdded
    FieldUpdated
    FieldDeleted

A class needs to inherit from SPListEventReceiver. You define the behaviour by overriding a method for one of the above before or after events. You can access the event properties using the parameter SPListEventProperties.

The events releating to list items are:

Before
    ItemAdding
    ItemUpdating
    ItemDeleting
After
    ItemAdded
    ItemUpdated
    ItemDeleted
    ItemAttachmentAdded
    ItemAttachmentDeleted
    ItemCheckedIn
    ItemCheckedOut
    ItemFileConverted
    ItemFileMoved
    ItemUncheckedOut

A class needs to inherit from SPItemEventReceiver. You then override a method for one of the above before or after events. The event properties can be accessed by the local parameter SPItemEventProperties. One of these is the list item.

Mr.--->RKMaloth

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜