Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think what you want to do here is send a message to the UI thread to take some action. You can pass this action has a delegate to the UI thread synchronously and asynchronously.</p> <p>Basically, have your non-UI thread pull a reference to some UI object (any pre-existing instance of the Control class will do, perhaps your RestoreDatabaseButton instance) and call the Invoke method on it, passing a delegate containing the code to be executed as the parameter. This will enqueue a message on the UI thread to execute the delegate in its context rather than the context of your non-UI thread. The UI thread might already have a stack of messages to process, clicks, mouse movement, resize, etc., and will handle each in the order it was received. The Invoke method, will not return until the delegate you passed has been executed.</p> <p>There's also a BeginInvoke method, this allows you to send a message to the UI thread that it will execute asynchronously. This method will return immediately, allowing your non-UI thread to continue executing even though the delegate may not have been executed yet. The EndInvoke method can be called after the BeginInvoke method and allows the non-UI thread to block until the delegate has been executed so that it can retrieve results from the delegate's execution. If the delegate doesn't return anything, there's no need to call this method.</p> <p>In either of these ways, your non-UI thread can influence the UI thread and take actions against objects the live on it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload