Re: BeginInvoke on MulticaseDelegate and params keyword... by Nick
Nick
Wed Apr 12 02:28:18 CDT 2006
This is a multi-part message in MIME format.
------=_NextPart_000_0045_01C65E0B.981238A0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Just do what intellisense tells you.
params is just a caller convenience. It's really just an array.
delegate void D(params int[] p);
D d;
d.BeginInvoke(new int[]{1,2,3},cb,o); =20
Note that the arguments are NOT params in BeginInvoke so you can write =
d(1,2,3) but not d.BeginInvoke(1,2,3,cb,o)
"Zhenxin Li" <imzxli@hotmail.com> wrote in message =
news:%23wQS8rdXGHA.1084@TK2MSFTNGP04.phx.gbl...
Hello,
If I use params keyword in my multicast delegate, can I call it using =
BeginInvoke? BeginInvoke takes some parameters after params keyword. I'm =
confused how to pass them after params...
Thanks!
Zhenxin Li#
------=_NextPart_000_0045_01C65E0B.981238A0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Just do what intellisense tells =
you.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>params is just a caller convenience. =
It's really=20
just an array.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>delegate void D(params int[] =
p);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>D d;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>d.BeginInvoke(new=20
int[]{1,2,3},cb,o); =
=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Note that the arguments are NOT params =
in=20
BeginInvoke so you can write d(1,2,3) but not=20
d.BeginInvoke(1,2,3,cb,o)</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Zhenxin Li" <<A=20
href=3D"mailto:imzxli@hotmail.com">imzxli@hotmail.com</A>> wrote in =
message=20
<A=20
=
href=3D"news:%23wQS8rdXGHA.1084@TK2MSFTNGP04.phx.gbl">news:%23wQS8rdXGHA.=
1084@TK2MSFTNGP04.phx.gbl</A>...</DIV>
<DIV><FONT face=3DTahoma color=3D#000080>Hello,</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080>If I use params keyword in my =
multicast=20
delegate, can I call it using BeginInvoke? BeginInvoke takes some =
parameters=20
after params keyword. I'm confused how to pass them after=20
params...</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080>Thanks!</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080>Zhenxin=20
Li#</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0045_01C65E0B.981238A0--