Show / Hide Table of Contents

Interface IArgument

Interface describing the methods and properties for an argument

Namespace: Benday.CommandsFramework
Assembly: Benday.CommandsFramework.dll
Syntax
public interface IArgument

Properties

| Edit this page View Source

Alias

The alternate name of the argument when used on the command line

Declaration
string Alias { get; set; }
Property Value
Type Description
string
| Edit this page View Source

AllowEmptyValue

Allow or disallow empty values

Declaration
bool AllowEmptyValue { get; }
Property Value
Type Description
bool
| Edit this page View Source

DataType

Data type for the argument

Declaration
[JsonConverter(typeof(JsonStringEnumConverter))]
ArgumentDataType DataType { get; }
Property Value
Type Description
ArgumentDataType
| Edit this page View Source

Description

Human readable description for the argument

Declaration
string Description { get; }
Property Value
Type Description
string
| Edit this page View Source

FriendlyName

Human readable name label for the argument

Declaration
string FriendlyName { get; }
Property Value
Type Description
string
| Edit this page View Source

HasAlias

Returns true if a command name alias is set

Declaration
bool HasAlias { get; }
Property Value
Type Description
bool
| Edit this page View Source

HasValue

Does this argument have a value?

Declaration
bool HasValue { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsPositionalSource

Should this value come from an unnamed argument on the command line? If yes, the Alias value will be the POSITION_x.

Declaration
bool IsPositionalSource { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsRequired

Is this argument required to have a value?

Declaration
bool IsRequired { get; }
Property Value
Type Description
bool
| Edit this page View Source

Name

Name of the argument on the command line

Declaration
string Name { get; set; }
Property Value
Type Description
string
| Edit this page View Source

Value

Value for the argument

Declaration
string Value { get; }
Property Value
Type Description
string

Methods

| Edit this page View Source

TrySetValue(string)

Try to set a value to this argument.

Declaration
bool TrySetValue(string input)
Parameters
Type Name Description
string input

Value to set

Returns
Type Description
bool

True if the value could be converted to the appropriate data type and was successfully set as the argument value.

| Edit this page View Source

Validate()

Validate the argument value against the argument definition information

Declaration
bool Validate()
Returns
Type Description
bool

True if the value is valid

  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com