DynamicInvoke on .Net CF

  • Thread starter Thread starter Matias Woloski
  • Start date Start date
M

Matias Woloski

I'm kind of newbies on Delegates... this works on .Net Fx but not on the
..Net CF
How can I make this work... I just want to invoke the delegate.
Just a regular event being raised and I want to broadcast the notification
to the subscribers. This is what I have.

public static void BroadcastEvent(Delegate eventToBroadcast, object
eventSender, EventArgs eventData) {
if(eventToBroadcast != null) {
object [] args = new object[] { eventSender, eventData };
foreach(Delegate callbackDelegate in
eventToBroadcast.GetInvocationList()) {
callbackDelegate.DynamicInvoke(args); <-- This line make it
crash on .net cf
}
}
}


thanks,
Matias
 
I suggest a couple workarounds in this thread (one relatively fast but
limited, one more general purpose but slow):

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=85C45EA6-9BA2-4B5
6-9A11-3AF6E5539666%40microsoft.com&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26
ie%3DISO-8859-1%26q%3Ddynamicinvoke%26btnG%3DSearch%26meta%3Dgroup%253Dmicro
soft.public.dotnet.framework.compactframework


--------------------
From: "Matias Woloski" <[email protected]>
Subject: DynamicInvoke on .Net CF
Date: Thu, 1 Apr 2004 15:01:32 -0300
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: ol77-165.fibertel.com.ar 24.232.165.77
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
..phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.compactframework:50083
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I'm kind of newbies on Delegates... this works on .Net Fx but not on the
.Net CF
How can I make this work... I just want to invoke the delegate.
Just a regular event being raised and I want to broadcast the notification
to the subscribers. This is what I have.

public static void BroadcastEvent(Delegate eventToBroadcast, object
eventSender, EventArgs eventData) {
if(eventToBroadcast != null) {
object [] args = new object[] { eventSender, eventData };
foreach(Delegate callbackDelegate in
eventToBroadcast.GetInvocationList()) {
callbackDelegate.DynamicInvoke(args); <-- This line make it
crash on .net cf
}
}
}


thanks,
Matias

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top