This project is read-only.

SPEventReceiverDefinitionCollection Extension Methods


void Add<T>(SPEventReceiverType receiverType)
Adds an event receiver to the collection.
SPList list = CreateListSomeHow();

// ListItemEventReceiver is a class that has the ItemUpdating and ItemUpdated implementations
list.EventReceivers.Add<ListItemEventReceiver>(SPEventReceiverType.ItemUpdating);
list.EventReceivers.Add<ListItemEventReceiver>(SPEventReceiverType.ItemUpdated);

void Remove<T>(SPEventReceiverType receiverType)
Removes an event receiver from the collection.
Note: This uses the type name, assembly name, and receiver type to find the element to remove.

bool Contains(Func<SPEventReceiverDefinition, bool> match)
Determines whether the specified SPEventReceiverDefinition can be found in the collection.

void RemoveAll()
Removes all the event receivers from the collection.

Last edited Feb 17, 2010 at 12:21 PM by jole, version 2

Comments

No comments yet.