Click or drag to resize

CommandLineArgumentAttributePosition Property

Gets or sets the position of a positional argument.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public int Position { get; set; }

Property Value

Type: Int32
The position of the argument, or a negative value if the argument can only be specified by name. The default value is -1.
Remarks

The Position property specifies the relative position of the positional arguments created by properties. If you skip any numbers, they will be ignored; if you have only two positional arguments with positions set to 4 and 7, they will be the first and second positional arguments, not the 4th and 7th. It is an error to use the same number more than once.

If you have arguments defined by the type's constructor parameters, positional arguments defined by properties will always come after them; for example, if you have two contructor parameter arguments and one property positional argument with position 0, then that argument will actually be the third positional argument.

The Position property will be set to reflect the actual position of the argument, which may not match the value of the Position property.

See Also