ValueDescriptionAttribute Class

Provides a custom value description for use in the usage help for an argument created from a constructor parameter.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 3.0.0
C#
public sealed class ValueDescriptionAttribute : Attribute
Inheritance
Object    Attribute    ValueDescriptionAttribute

Remarks

The value description is a short, typically one-word description that indicates the type of value that the user should supply.

If not specified here, it is retrieved from the DefaultValueDescriptions property, and if not found there, the type of the property is used, applying the NameTransform specified by the ValueDescriptionTransform property or the ValueDescriptionTransform property. If this is a multi-value argument, the element type is used. If the type is NullableT, its underlying type is used.

If you want to override the value description for all arguments of a specific type, use the DefaultValueDescriptions property.

The value description is used when printing usage. For example, the usage for an argument named Sample with a value description of String would look like "-Sample <String>".

  Note

This is not the long description used to describe the purpose of the argument. That should be specified using the DescriptionAttribute attribute.

Constructors

ValueDescriptionAttribute Initializes a new instance of the ValueDescriptionAttribute class.

Properties

TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)
ValueDescription Gets the custom value description.

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
GetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also