Execute(Action) Method

Summary
Executes the specified delegate.
Syntax
C#
C++/CLI
public static AsyncResult Execute( 
   Action d 
) 
public: 
static AsyncResult^ Execute(  
   Action^ d 
)  

Parameters

d
The delegate to execute asynchronously.

Return Value

The asynchronous result.

Example

Executes an asynchronous method.

C#
using Leadtools.Dicom.AddIn; 
 
 
public void ThreadFunction() 
{ 
   for (int i = 0; i < 1000; i++) 
   { 
      Console.WriteLine("Count: {0}", i); 
   } 
} 
public void TestExecute() 
{ 
   AsyncResult r = AsyncHelper.Execute(new Action(ThreadFunction)); 
 
   // 
   // Wait 1 second for the thread to finish. 
   // 
   r.Wait(1000); 
   if (r.IsCompleted) 
      Console.WriteLine("Completed"); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.2.9
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.AddIn Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.