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!

ParameterInfo.IsOptional

Retrieves whether this parameter is optional.

[Visual Basic]
Public ReadOnly Property IsOptional As Boolean
[C#]
public bool IsOptional {get;}
[C++]
public: __property bool get_IsOptional();
[JScript]
public function get IsOptional() : Boolean;

Property Value

Read-only.

Retrieves whether Optional is set for this parameter.

true if the parameter is optional; otherwise, false.

Remarks

This method depends on an optional metadata flag. This flag may be inserted by compilers, but the compilers are not obligated to do so.

This method utilizes the ParameterAttributes.Optional method.

To get the ParameterInfo array, first get the method. From the method, get the Type. From the Type, get the ParameterInfo array.

If the parameter is an optional parameter, the IsIOptional is True. Otherwise it is False.

See Also

ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace