object named argument

B

bill tie

In Vs2k10, when I write

IAsyncResult result = myFunkyDelegate.BeginInvoke(arg1, arg2, ...)

Intellisense offers named arguments, e.g. "callback:", in which case I write
callback: new AsyncCallback(myMethod).

For the argument that is passed to the callback method, Intellisense offers
"object:". If I accept the offered name, and write object: myFunkyDelegate,
the compiler doesn't like it, probably because the name "object" conflicts
with the C# keyword.

How should a situation like this be dealt with?
 
J

Jeff Johnson

In Vs2k10, when I write

IAsyncResult result = myFunkyDelegate.BeginInvoke(arg1, arg2, ...)

Intellisense offers named arguments, e.g. "callback:", in which case I
write
callback: new AsyncCallback(myMethod).

For the argument that is passed to the callback method, Intellisense
offers
"object:". If I accept the offered name, and write object:
myFunkyDelegate,
the compiler doesn't like it, probably because the name "object" conflicts
with the C# keyword.

How should a situation like this be dealt with?

....don't use the named argument syntax?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top