AsyncHelper for VB.NET

By Fons Sonnemans, 21-4-2005

I received a mail today from Rolf Gasber asking me whether I could help him with a VB.NET version of the AsyncHelper which I used in an earlier post. Here it is:

Public Class AsyncHelper

    Private Delegate Sub DynamicInvokeShimProc(ByVal d As [Delegate], _
ByVal args() As Object)

    Private Shared _dynamicInvokeShim As _
New DynamicInvokeShimProc(AddressOf DynamicInvokeShim)

    Private Shared _dynamicInvokeDone As _
New AsyncCallback(AddressOf DynamicInvokeDone)

    Public Shared Sub FireAndForget(ByVal d As [Delegate], _
ByVal ParamArray args() As Object)
        _dynamicInvokeShim.BeginInvoke(d, args,
AddressOf _
 DynamicInvokeDone, Nothing)
    End Sub

    Private Shared Sub DynamicInvokeShim(ByVal d As [Delegate], _
ByVal args() As Object)
    End Sub

    Private Shared Sub DynamicInvokeDone(ByVal ar As IAsyncResult)
    End Sub

End Class

Tags: VB

Leave a Comment

Leave a Comment
2 + 1 =


All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.