U
utkarsh
Hi All,
I am using the following method "FireAsync" (i got the following
information from the google groups) to fire the event for all the
subscribers.
Is there another way to fire the event to all the subscriber
asynchronously efficiently. As because in my application this method is
being call 60-100 times a second.
Any idea?
---------------------------------------------------------------------
delegate void AsyncInvokeDelegate(Delegate del, params object[] args);
public static void FireAsync(Delegate del, params object[] args)
{
if (del == null)
{
return;
}
Delegate[] delegates = del.GetInvocationList();
AsyncInvokeDelegate invoker = new
AsyncInvokeDelegate(InvokeDelegate);
foreach (Delegate sink in delegates)
{
invoker.BeginInvoke(sink,args,null,null);
}
}
private static void InvokeDelegate(Delegate sink, params object[] args)
{
try
{
sink.DynamicInvoke(args);
}
catch
{}
}
I am using the following method "FireAsync" (i got the following
information from the google groups) to fire the event for all the
subscribers.
Is there another way to fire the event to all the subscriber
asynchronously efficiently. As because in my application this method is
being call 60-100 times a second.
Any idea?
---------------------------------------------------------------------
delegate void AsyncInvokeDelegate(Delegate del, params object[] args);
public static void FireAsync(Delegate del, params object[] args)
{
if (del == null)
{
return;
}
Delegate[] delegates = del.GetInvocationList();
AsyncInvokeDelegate invoker = new
AsyncInvokeDelegate(InvokeDelegate);
foreach (Delegate sink in delegates)
{
invoker.BeginInvoke(sink,args,null,null);
}
}
private static void InvokeDelegate(Delegate sink, params object[] args)
{
try
{
sink.DynamicInvoke(args);
}
catch
{}
}