Click here to Skip to main content
15,918,596 members

Comments by ThatsAlok (Top 172 by date)

ThatsAlok 19-Dec-13 12:39pm View    
yeah i agree.. i missed that...apologies for any misconduct :-)
ThatsAlok 19-Dec-13 12:21pm View    
agree its similar to you... but frankly i hav'nt copied from you :-)...
ThatsAlok 19-Dec-13 4:52am View    
Here :-
public delegate int delegateReturnInt();
event delegateReturnInt evntdelegateReturnInt;

public delegate void delegateReturnIntRef(ref int value);
event delegateReturnIntRef evntdelegateReturnIntRef;
evntdelegateReturnInt += new delegateReturnInt(Form1_evntdelegateReturnInt10);
evntdelegateReturnInt += new delegateReturnInt(Form1_evntdelegateReturnInt20);

evntdelegateReturnIntRef += new delegateReturnIntRef(Form1_evntdelegateReturnIntRef);
evntdelegateReturnIntRef += new delegateReturnIntRef(Form1_evntdelegateReturnIntRef2);

One Way - by using invocation list !-
var list = evntdelegateReturnInt.GetInvocationList();
foreach (var handler in list)
delegateReturnInt method = (delegateReturnInt)handler;
int retValue = method();
//do something with retValue...

Second way:- not good, however

int value = 20;
evntdelegateReturnIntRef.Invoke(ref value);
ThatsAlok 18-Dec-13 1:54am View    
better to put parameter as reference, if you want to return values from multicast delegate
ThatsAlok 28-Oct-13 9:38am View    
Reason for my vote of 5 \n thats useful for other stuffs too :-)...