I've been developing modules for quite some time in DotNetNuke, and I have run into instances where some of our modules and providers occaisionally need to be able to subscribe to certain DotNetNuke "events" as they happen, so that we can execute some code when the event happens. To date, I haven't been able to find any documentation or examples on how this can be achieved effectively.
As DotNetNuke team members begin to develop the next version (5.0), I think that they should consider incorporating "events" and eventHandler subscription into the framework. Let me explain by example. In one use-case, our module needs to be able to "know" when a new user registers on the portal. It would be nice if DotNetNuke exposed an event called "evtNewUserRegistered", and passed the userInfo object as the context. This way, our module could register an eventHandler of sorts that could subscribe to this event, and perform some code execution everytime a user registered on the site. Another example use-case would be when a user adds a page to the site, we might want to subscribe to this "event", and the event should pass the Page object as the context so that we could execute some code during this event. This type of model builds on the typical Microsoft event handling that already exists in .NET.
Has anyone else ever run into this type of use-case before?
Do you think DotNetNuke should incorporate such an extension of the framework?
Thanks!
-- Will Gillen