SharePoint of the Day #29

You can only Cancel an -ing type event, for example ItemAdding or ItemUpdating, but not the -ed type events. To cancel an item event, set SPItemEventProperties.Cancel to true. You will get the correct SPItemEventProperties object as a parameter to the method call.
Delicious Digg This Post

Posted under Developer

This post was written by spotd on May 11, 2009

Tags:

SharePoint of the Day #23

You can add event receivers to SharePoint objects using the object model. Any object that supports even receivers has an EventReceivers collection to which you can Add() new receivers.
If you want to add event receivers to specific list instances or content type instances, for example, you must use the object model.
Delicious Digg [...]

Posted under Developer

This post was written by spotd on May 1, 2009

Tags:

SharePoint of the Day #17

When overriding event receiver methods you can access the current list item, list, web, and site through the Properties object passed to the method you are overriding:
SPListItem item = properties.ListItem;
SPList list = properties.List;
Delicious Digg This Post

Posted under Developer

This post was written by spotd on April 23, 2009

Tags: