SharePoint Event Handler 测试工程
工作需要,有时候会测试各种情况下Event Handler,包括测试哪种事件是最合适的,但是每次写Event Handler的Feature的确是重复性麻烦的事情。所以就写了个代码生成的小程序生成了下面的37个工程,对应37个不同的List模板。ListTemplateId来自于http://msdn.microsoft.com/en-us/library/ms431081.aspx。
工程注册了所有的List和ListItem事件。参考:SPItemEventReceiver Methods (Microsoft.SharePoint)和
SPListEventReceiver Methods (Microsoft.SharePoint)
工程基于WSPBuilder (SharePoint WSP tool), 所以使用这个工程前请自行下载并熟悉其用法。
下载地址:LambertQin.Samples.EventHandlers.zip
更多的关于Event Handlers的文章,可以参考以下链接:
- 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 Receiver in Windows SharePoint Services 3.0 (http://msdn.microsoft.com/en-us/library/bb736146.aspx)