The inline documentation for the IsPresent property states that it returns true if the parameter was specified on the command line, and false otherwise:
/// <summary>
/// Returns true if the parameter was specified on the command line, false otherwise.
/// </summary>
/// <value>True if the parameter was specified, false otherwise</value>
public bool IsPresent
{
get { return _isPresent; }
}
However, this description is inaccurate. The property returns false when a parameter is explicitly specified on the command line with a value of false.
Proposed Resolution
Either:
- Clarify documentation to specify that the property returns
false both when the parameter is not specified and when it is explicitly specified with a value of false; or
- Adjust implementation so that
IsPresent returns true whenever the parameter is explicitly supplied, regardless of its value.
- Deprecate
IsPresent in favor of a clearer or more accurately named property that distinguishes between 'parameter presence' and 'parameter value'.
The inline documentation for the
IsPresentproperty states that it returnstrueif the parameter was specified on the command line, andfalseotherwise:However, this description is inaccurate. The property returns
falsewhen a parameter is explicitly specified on the command line with a value offalse.Proposed Resolution
Either:
falseboth when the parameter is not specified and when it is explicitly specified with a value offalse; orIsPresentreturnstruewhenever the parameter is explicitly supplied, regardless of its value.IsPresentin favor of a clearer or more accurately named property that distinguishes between 'parameter presence' and 'parameter value'.