Problems with dispatcher in C# console application
I need to invoke method runed on timer thread on right working thread. Invoke/BeginInvoke process is working for me. There are 2 threads which shares one inter thread data container for data exchange. One is filling queue, one shuld process the queue. Queue raises event if it is filled after empty state. All the problem is caused by timer, which open new thread on its elapsed event. I am using Dispatcher to dispatch on the right thread, but everything works, except this Dispatcher. :-) Please, does anybody see where the problem is? Complete test code is here: http://pastebin.com/jqYbR9PS .