I have a background thread running that fires events, but how can I ensure a thread safe invocation of these events using NET CF?
I would use ISyncronizeInvoke on the NET platform, but I can’t find this on NET CF. I’m sure there are an equivalent available…. or?
The Compact Framework does have
Control.Invoke/BeginInvoke, although I believe it’s limited to theEventHandlerdelegate (with any other delegate throwing an exception at execution time).Assuming your actual instance of
ISynchronizeInvokeis going to be a UI control, I’d just pass the reference asControlto whatever needs it. If you really want to use an interface, you could always create your ownISynchronizeInvokeinterface, and then an implementation which just wrapsControl.