Esporta (0) Stampa
Espandi tutto

BackgroundWorker.RunWorkerAsync Method

Starts running a background operation.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public void RunWorkerAsync()

The RunWorkerAsync method submits a request to start the operation running asynchronously. When the request is processed, the DoWork event is raised, which in turn starts running your background operation.

If the background operation is already running, calling RunWorkerAsync again will raise an InvalidOperationException.

The following code example demonstrates the use of the RunWorkerAsync method to start a background operation. To view the complete code for this sample, see How to: Use a Background Worker.


private void buttonStart_Click(object sender, RoutedEventArgs e)
{
    if (bw.IsBusy != true)
    {
        bw.RunWorkerAsync();
    }
}


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft