IoC Update: Event Migration with Aggregation

I just checked in another update to the OpenNETCF.IoC framework.  If you’ve used the framework for event aggregation you’re probably aware that an EventSubscrition can set the ThreadOption to “UserInterface” but that had no effect.  We’ll I’ve fixed that – at least partially.  Up until now I couldn’t figure a way to wire up any arbitrary delegate without the availability of Emit. Today I had the idea that implementing a known subset could be done without Emit, but instead hard-coding a class into the framework that handles doing the Invoke call to get the event into the proper context.  Now if your event handler is of type EventHandler or, more importantly, EventHandler<T> (meaning that if you use the GenericEventArgs already present in the framework, you’re all set), you don’t have to call InvokeRequired and Invoke any longer – the framework handles it for you (and I really wish I’d done that 6 months ago – would’ve saved me a lot of headache).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s