Home All Groups Group Topic Archive Search About

BeginInvoke on MulticaseDelegate and params keyword...

Author
12 Apr 2006 2:44 AM
Zhenxin Li
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

Author
12 Apr 2006 7:28 AM
Nick Hounsome
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);         

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" <imz***@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#
Author
12 Apr 2006 9:04 AM
Zhenxin Li
Yes. I was confused by intellisense. Thank you!
  "Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message news:m_1%f.37269$8Q3.33216@fe1.news.blueyonder.co.uk...
  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);         

  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" <imz***@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#

AddThis Social Bookmark Button