Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange method call
Message
De
09/03/2014 16:02:47
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01595999
Message ID:
01596000
Vues:
64
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>In the VC# article http://social.technet.microsoft.com/wiki/contents/articles/23110.overload-resolution-revisited-in-net-4-5.aspx I see the following call:
>
ExampleMethod(p2: "");
>I never saw that syntax before - can you please explain it to me?
>Thanks in advance.


It's a feature derived from Visual Basic, called a named parameter. It allows you to pass parameters which are out of order, and to instruct the compiler which parameter each one is:

See: http://www.dotnetperls.com/named-parameters
See: http://msdn.microsoft.com/en-us/library/dd264739.aspx

In this case, the parameter is named "p2" and you are passing it an empty string.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform