Hi,
We have a silverlight application which uses a dispatcher and I would appreciate any help explaining what the following codes does? (unfortunately the developer who wrote the code has left).
So what we have is the following:
Public Class ABC {
private Dispatcher dispatcher;
private Thread threadRunner;
Public void ABC()
{
threadRunner= new Thread(ThreadRunnerMethod)
{
IsBackground = true,
ApartmentState = ApartmentState.STA
};
threadRunner.Start();
}
private static void ThreadRunnerMethod()
{
Dispatcher.Run();
}
Public void MainMethod()
{
dispatcher = Dispatcher.FromThread(threadRunner);
dispatcher.Invoke(new Action(() =>
// "DO SOME WORK WITH A COM OBJECT"
));
}
}
I have some basic experience with threading but I have no idea how this all works?
JD