Show / Hide Table of Contents

Class DateTimeArgument

Argument implementation for working with DateTime values

Inheritance
object
Argument<DateTime>
DateTimeArgument
Implements
IArgument
IDateTimeArgument
Inherited Members
Argument<DateTime>.OnInitialize()
Argument<DateTime>.Description
Argument<DateTime>.FriendlyName
Argument<DateTime>.Value
Argument<DateTime>.HasValue
Argument<DateTime>.Name
Argument<DateTime>.Alias
Argument<DateTime>.HasAlias
Argument<DateTime>.IsPositionalSource
Argument<DateTime>.IsRequired
Argument<DateTime>.AllowEmptyValue
Argument<DateTime>.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 DateTimeArgument : Argument<DateTime>, IArgument, IDateTimeArgument

Constructors

| Edit this page View Source

DateTimeArgument(string)

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

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

Name of the argument on the command line

Properties

| Edit this page View Source

CultureInfo

Declaration
public CultureInfo? CultureInfo { get; set; }
Property Value
Type Description
CultureInfo
| Edit this page View Source

DataType

Argument data type

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

ValueAsDateTime

Value as DateTime

Declaration
public DateTime ValueAsDateTime { get; }
Property Value
Type Description
DateTime

Methods

| Edit this page View Source

GetDefaultValue()

Default value for this argument.

Declaration
protected override DateTime GetDefaultValue()
Returns
Type Description
DateTime

DateTime.MinValue

Overrides
Argument<DateTime>.GetDefaultValue()
| Edit this page View Source

TrySetValue(string)

Try to set a string value to this DateTime 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 and set into the value

Overrides
Argument<DateTime>.TrySetValue(string)

Implements

IArgument
IDateTimeArgument

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