I use a flashlight that can have n instances. The problem is the DoWork method (which has the "sender" parameter, which is BackgroundWorker) calls another code that calls the callback, so I have no sender.
How can I tell BackgroundWorker what the current code is working under?
Example:
private void SetupThread()
{
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(DoTheWork);
}
private void DoTheWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
MyClass.DoSomething();
}
private void MethodCalledFromEventCallback()
{
}
I probably just missed something (unless threadpool is ok :-()
I'm sure it is easy to handle BackgroundWorker ... any ideas?
change
, :-)
1.) bw.RunWorkerAsync()
2.) , MethodCalledFromEventCallback,
3.) (- )
: -)