c# - Remove need for Invoke() by handling within threaded library -


I am writing in a classroom library that I have a way to go to the library and some stuff on a different thread Does something like this:

  Public Zero DoStuffAsync (APP) {this.Running = true; this. Cancel = false; Parametted Thread Start Thread Start = New Parameterated TraderStart (DUSTF); Thread procThread = new thread (threadstart); ProcThread.Start (p); }  

I have many such events that can be declared by developers on these interfaces, such as StatusUpdate and ProgressUpdate. I am currently writing a small test app (currently in WPF though I expect the same behavior in WinForms) which calls DoStuffAsync () and then updates a progress bar and label.

Unfortunately 1A got an error, I do not have a common thread which is the owner of control What I want to do, the need to call the request () to the user removed from the UI , And just for them to subscribe to events and to work them.

So the question is, one way I can do this while working with event handler? Currently triggered like this:

  Public Zero UpdateProgress (Object Sender, ProgressEventErages E) {if (Handler! = Faucet) {Handler (Sender, E); }}  

Use instead.

Call it for you (internally uses this synchronization contact like Aruguz's description)


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -