ModulePage.StartAsyncTask Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts the task by using a worker thread.
Overloads
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker, Object) |
Starts the task by using a worker thread, based on the specified progress text, argument object, and handlers for work, completion, and cancellation. |
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker) |
Starts the task by using a worker thread, based on the specified progress text and handlers for work, completion, and cancellation. |
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler) |
Starts the task by using a worker thread, based on the specified progress text and handlers for work and completion. |
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker, Object)
Starts the task by using a worker thread, based on the specified progress text, argument object, and handlers for work, completion, and cancellation.
protected:
void StartAsyncTask(System::String ^ progressText, System::ComponentModel::DoWorkEventHandler ^ doWorkHandler, System::ComponentModel::RunWorkerCompletedEventHandler ^ workCompletedHandler, System::Windows::Forms::MethodInvoker ^ cancelTaskHandler, System::Object ^ argument);
protected void StartAsyncTask (string progressText, System.ComponentModel.DoWorkEventHandler doWorkHandler, System.ComponentModel.RunWorkerCompletedEventHandler workCompletedHandler, System.Windows.Forms.MethodInvoker cancelTaskHandler, object argument);
member this.StartAsyncTask : string * System.ComponentModel.DoWorkEventHandler * System.ComponentModel.RunWorkerCompletedEventHandler * System.Windows.Forms.MethodInvoker * obj -> unit
Protected Sub StartAsyncTask (progressText As String, doWorkHandler As DoWorkEventHandler, workCompletedHandler As RunWorkerCompletedEventHandler, cancelTaskHandler As MethodInvoker, argument As Object)
Parameters
- progressText
- String
The progress message.
- doWorkHandler
- DoWorkEventHandler
The DoWorkEventHandler that represents the method that will handle the DoWork event.
- workCompletedHandler
- RunWorkerCompletedEventHandler
The RunWorkerCompletedEventHandler that represents the method that will run when the work is completed.
- cancelTaskHandler
- MethodInvoker
The MethodInvoker delegate that is called when the task is canceled.
- argument
- Object
An object for use by the worker thread.
Remarks
Only one task can run at a time. If the StartAsyncTask method is called before the previous StartAsyncTask call is complete, the previous task will be canceled.
Applies to
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker)
Starts the task by using a worker thread, based on the specified progress text and handlers for work, completion, and cancellation.
protected:
void StartAsyncTask(System::String ^ progressText, System::ComponentModel::DoWorkEventHandler ^ doWorkHandler, System::ComponentModel::RunWorkerCompletedEventHandler ^ workCompletedHandler, System::Windows::Forms::MethodInvoker ^ cancelTaskHandler);
protected void StartAsyncTask (string progressText, System.ComponentModel.DoWorkEventHandler doWorkHandler, System.ComponentModel.RunWorkerCompletedEventHandler workCompletedHandler, System.Windows.Forms.MethodInvoker cancelTaskHandler);
member this.StartAsyncTask : string * System.ComponentModel.DoWorkEventHandler * System.ComponentModel.RunWorkerCompletedEventHandler * System.Windows.Forms.MethodInvoker -> unit
Protected Sub StartAsyncTask (progressText As String, doWorkHandler As DoWorkEventHandler, workCompletedHandler As RunWorkerCompletedEventHandler, cancelTaskHandler As MethodInvoker)
Parameters
- progressText
- String
The progress message.
- doWorkHandler
- DoWorkEventHandler
The DoWorkEventHandler that represents the method that will handle the DoWork event.
- workCompletedHandler
- RunWorkerCompletedEventHandler
The RunWorkerCompletedEventHandler that represents the method that will run when the work is completed.
- cancelTaskHandler
- MethodInvoker
The MethodInvoker delegate that is called when the task is canceled.
Remarks
Only one task can run at a time. If the <xref:Microsoft.Web.Management.Client.Win32.%2A>[StartAsyncTask Method (String, DoWorkEventHandler, RunWorkerCompletedEventHandler,]() method is called before the previous StartAsyncTask call is complete, the previous task will be canceled.
Applies to
StartAsyncTask(String, DoWorkEventHandler, RunWorkerCompletedEventHandler)
Starts the task by using a worker thread, based on the specified progress text and handlers for work and completion.
protected:
void StartAsyncTask(System::String ^ progressText, System::ComponentModel::DoWorkEventHandler ^ doWorkHandler, System::ComponentModel::RunWorkerCompletedEventHandler ^ workCompletedHandler);
protected void StartAsyncTask (string progressText, System.ComponentModel.DoWorkEventHandler doWorkHandler, System.ComponentModel.RunWorkerCompletedEventHandler workCompletedHandler);
member this.StartAsyncTask : string * System.ComponentModel.DoWorkEventHandler * System.ComponentModel.RunWorkerCompletedEventHandler -> unit
Protected Sub StartAsyncTask (progressText As String, doWorkHandler As DoWorkEventHandler, workCompletedHandler As RunWorkerCompletedEventHandler)
Parameters
- progressText
- String
The progress message.
- doWorkHandler
- DoWorkEventHandler
The DoWorkEventHandler that represents the method that will handle the DoWork event.
- workCompletedHandler
- RunWorkerCompletedEventHandler
The RunWorkerCompletedEventHandler that represents the method that will run when the work is completed.
Remarks
Only one task can run at a time. If the StartAsyncTask method is called before the previous StartAsyncTask call is complete, the previous task will be canceled.