Work is required. Sometimes event handler is tested in various cases, including the event to be tested, but the feature of the event handler written each time is indeed repetitive and troublesome. So I wrote a code-generated applet to generate the following 37 projects, corresponding to 37 different List Templates. The listtemplateid is from http://msdn.microsoft.com/en-us/library/ms4320.1.aspx.
The project registers all list and listitem events. Refer to: spitemeventreceiver methods (Microsoft. SharePoint) and
Splisteventreceiver methods (Microsoft. SharePoint)
The project is based on wspbuilder (SharePoint WSP tool). Before using this project, please download it and familiarize yourself with its usage.
: Lambertqin.samples.eventhandlers.zip
For more articles about event handlers, refer to the following links:
- Event Handlers (also known as event receivers) (http://msdn.microsoft.com/en-us/library/cc537498.aspx#MOSSIntroToNet_ComponentsEventHandlers)
- Event fundamentals (http://msdn.microsoft.com/en-us/library/ms442323.aspx)
- Event Handlers (http://www.microsoft.com/winme/0901/34867/mod7/index.html)
- How to: create an event handler feature (http://msdn.microsoft.com/en-us/library/ms453149.aspx)
- Creating and using event handlers in Windows SharePoint Services V3 (http://channel9.msdn.com/shows/In+the+Office/Creating-and-Using-Event-Handlers-in-Windows-SharePoint-Services-V3)
- Building list definitions with event recorder er in Windows SharePoint Services 3.0 (http://msdn.microsoft.com/en-us/library/bb736146.aspx)