Show / Hide Table of Contents

Class BooleanArgument

Argument implementation for working with boolean values

Inheritance
object
Argument<bool>
BooleanArgument
Implements
IArgument
IBooleanArgument
Inherited Members
Argument<bool>.OnInitialize()
Argument<bool>.Description
Argument<bool>.FriendlyName
Argument<bool>.Value
Argument<bool>.HasValue
Argument<bool>.Name
Argument<bool>.Alias
Argument<bool>.HasAlias
Argument<bool>.IsPositionalSource
Argument<bool>.IsRequired
Argument<bool>.AllowEmptyValue
Argument<bool>.Validate()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CommandsFramework
Assembly: Benday.CommandsFramework.dll
Syntax
public class BooleanArgument : Argument<bool>, IArgument, IBooleanArgument

Constructors

| Edit this page View Source

BooleanArgument(string)

Constructor. Creates an argument definition without a value. This is typically used in a command for describing the available arguments.

Declaration
public BooleanArgument(string name)
Parameters
Type Name Description
string name

Name of the argument on the command line

Properties

| Edit this page View Source

DataType

Argument data type

Declaration
public override ArgumentDataType DataType { get; }
Property Value
Type Description
ArgumentDataType
Overrides
Argument<bool>.DataType
| Edit this page View Source

ValueAsBoolean

Value as boolean

Declaration
public bool ValueAsBoolean { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

GetDefaultValue()

Default value for the argument. If this argument is configured to allow empty values, the default value will be false. Otherwise, the default value is true.

Declaration
protected override bool GetDefaultValue()
Returns
Type Description
bool
Overrides
Argument<bool>.GetDefaultValue()
| Edit this page View Source

TrySetValue(string)

Try to set a string value to this boolean argument

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

Value as string

Returns
Type Description
bool

True if the value was successfully converted to bool and set into the value

Overrides
Argument<bool>.TrySetValue(string)

Implements

IArgument
IBooleanArgument

Extension Methods

ExtensionMethods.AllowEmptyValue<T>(Argument<T>, bool)
ExtensionMethods.AsNotRequired<T>(Argument<T>)
ExtensionMethods.AsRequired<T>(Argument<T>)
ExtensionMethods.ExistenceOptional<T>(Argument<T>)
ExtensionMethods.FromPositionalArgument<T>(Argument<T>, int)
ExtensionMethods.MustExist<T>(Argument<T>)
ExtensionMethods.WithAlias<T>(Argument<T>, string)
ExtensionMethods.WithDefaultValue<T>(Argument<T>, T)
ExtensionMethods.WithDescription<T>(Argument<T>, string)
ExtensionMethods.WithFriendlyName<T>(Argument<T>, string)
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com