Executes the specified delegate.
public static AsyncResult Execute(
Action d
)
Public Overloads Shared Function Execute( _
ByVal d As Action _
) As AsyncResult
public:
static AsyncResult^ Execute(
Action^ d
)
d
The delegate to execute asynchronously.
The asynchronous result.
Executes an asynchronous method.
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");
}
Imports Leadtools.Dicom.AddIn
Public 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
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document