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;
Read-only.
Retrieves whether Optional is set for this parameter.
true if the parameter is optional; otherwise, false.
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.
ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace