ValueDescriptionAttribute Class

Supplies a short description of an argument value to use when printing usage information.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 5.0.0+724ca9b7fa5edc075ec2ae65044e61b0d494fd1c
C#
public 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.

The value description is used when generating usage help. 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 can be set using the DescriptionAttribute attribute.

You can apply this attribute to a property or method defining an argument to set the value description for that argument. You can also apply it to a type to set a default value description for that type.

If this attribute is not present, the name of the type of the argument is used by default, applying the name transformation specified by the ParseOptionsValueDescriptionTransform property or the ParseOptionsAttributeValueDescriptionTransform property.

If a custom value description is set using this attribute, the name transformation is not applied unless the ApplyTransform property is .

If you want to override the value description for all arguments of a specific type, and you cannot apply the ValueDescriptionAttribute to this type, you can use the ParseOptionsDefaultValueDescriptions property.

You can derive from this attribute to use an alternative source for the value description, such as a resource table that can be localized.

Constructors

ValueDescriptionAttribute Initializes a new instance of the ValueDescriptionAttribute attribute.

Properties

ApplyTransform Gets or sets a value that indicates whether the custom value description should be transformed according to the ParseOptionsValueDescriptionTransform property.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)
ValueDescription Gets the value description for the argument.
ValueDescriptionValue Gets the value description stored in this attribute.

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
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)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also