Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What syntax is it?
Message
From
05/04/2009 09:34:55
 
 
To
05/04/2009 09:08:58
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01393308
Message ID:
01393322
Views:
46
I believe named parameters are for version 4. In addition, the args are not between ( and ), so it cannot be a method/constructor call
( see http://blogs.windowsclient.net/alesrosina/archive/2008/12/02/new-stuff-in-c-4-0.aspx under optional parameters)

Looks like an object/collection initializer (http://msdn.microsoft.com/en-us/library/bb308966.aspx#csharp3.0overview_topic13 - see 26.4 Object and Collection Initializers)


I'd say it is the shorthand for
var xx = new ComparisonContract<Foo>() ;
xx.ImplementsOperatorOverloads = true ;
xx. EquivalenceClasses =  {
     { new Foo(1) },    // What is this?
      { new Foo(2) },
      { new Foo(3) }
   }
>Hi,
>But, what is ImplementsOperatorOverloads = true; ? Named parameter?
>
>
>new ComparisonContract<Foo>
>>>  { // What is this?
>>>    ImplementsOperatorOverloads = true; // Optional (default is true)
>>>    EquivalenceClasses =
>>>    {
>>>      { new Foo(1) },    // What is this?
>>>      { new Foo(2) },
>>>      { new Foo(3) }
>>>    }
>
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform