February 2010
Beginner
400 pages
11h 13m
English
C# 2010 introduces two useful features that have been present in VB for a long time: optional and named parameters (technically two separate features but often found together).
Named parameters allow you to pass parameters into a function in any order and are near essential when using C#'s other new feature: optional parameters. To use a named parameter, simply specify the parameter name followed by a colon and then the value you are passing into a function. The following code illustrates passing the value 1 to a method's Copies parameter, COLOR to the ColorMode parameter, and readme.txt to DocumentName:
Print(Copies:1,ColorMode:"COLOR",DocumentName:"readme.txt"); static void Print(string ...