An alternative to the Dispatcher class (from .net 3.0) for use in a .net 2.0 context

I need an alternative for Dispatcher(.net 3.0) to use for a Windows service (made in .net 2.0). Can you give me an idea on how to achieve something like this or point me to some links?

I know what the dispatcher has SynchronizationContext, but I don’t know how I can use SynchronizationContextthe service.

If you think I should stick with Dispatcher(.net 3.0) ... how can I manipulate it ( OnServiceStop, OnServiceStart)

edited: More (see Also ... here )

The idea is that I would like to place some extensions / plugins in my Windows service that will interact with each other using the method ExecuteCommand(type, params).

This method also raises an event for the service to get results if it was executed from inside the plugin. Each plugin can have its own thread from which it calls this method ExecuteCommand, so I would like to collect and synchronize all calls into one thread (the main service thread) in order to return the result accordingly.

This is why Dispatcher entered the game. But I would like to have maybe something in .net 2.0, or do you think the Dispatcher is good in my case?

Thank.

+1
1

Windows Dispatcher ( Windows Forms). , "target" .

, , .

EDIT: , , /: , -, . , .

/ , . (.NET 4 , .NET. 2.) , , . Joe Albahari , .

+2

Source: https://habr.com/ru/post/1758869/


All Articles