NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

10.5.1 Method parameters

The parameters of a method, if any, are declared by the method’s formal-parameter-list.

formal-parameter-list:
formal-parameter
formal-parameter-list
, formal-parameter
formal-parameter:
attributesopt parameter-modifieropt type identifier
parameter-modifier:
ref
out
params

The formal parameter list consists of zero or more formal-parameters, separated by commas. A formal-parameter consists of an optional set of attributes (§17), an optional modifier, a type, and an identifier. Each formal-parameter declares a parameter of the given type with the given name.

A method declaration creates a separate declaration space for parameters and local variables. Names are introduced into this declaration space by the formal parameter list of the method and by local variable declarations in the block of the method. All names in the declaration space of a method must be unique. Thus, it is an error for a parameter or local variable to have the same name as another parameter or local variable.

A method invocation (§7.5.5.1) creates a copy, specific to that invocation, of the formal parameters and local variables of the method, and the argument list of the invocation assigns values or variable references to the newly created formal parameters. Within the block of a method, formal parameters can be referenced by their identifiers in simple-name expressions (§7.5.2).

There are four kinds of formal parameters:

As described in §3.4, parameter modifiers are part of a method’s signature.