LEADTOOLS Medical (Leadtools.Dicom.AddIn assembly)
LEAD Technologies, Inc

Execute(Action) Method

Example 





The delegate to execute asynchronously.
Executes the specified delegate.
Syntax
public static AsyncResult Execute( 
   Action d
)
'Declaration
 
Public Overloads Shared Function Execute( _
   ByVal d As Action _
) As AsyncResult
'Usage
 
Dim d As Action
Dim value As AsyncResult
 
value = AsyncHelper.Execute(d)
public static AsyncResult Execute( 
   Action d
)
 function Leadtools.Dicom.AddIn.AsyncHelper.Execute(Action)( 
   d 
)
public:
static AsyncResult^ Execute( 
   Action^ d
) 

Parameters

d
The delegate to execute asynchronously.

Return Value

The asynchronous result.
Example
 
Private Sub ThreadFunction()
   For i As Integer = 0 To 999
      Console.WriteLine("Count: {0}", i)
   Next i
End Sub

Public Sub TestExecute()
   Dim r As AsyncResult = AsyncHelper.Execute(New Action(AddressOf ThreadFunction))

   '
   ' Wait 1 second for the thread to finish.
   '
   r.Wait(1000)
   If r.IsCompleted Then
      Console.WriteLine("Completed")
   End If
End Sub
private 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: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AsyncHelper Class
AsyncHelper Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom.AddIn requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features