4using System.Collections.Generic;
11 private TypeInfo(Type current, IEnumerable<Type> choices)
23 return new TypeInfo(current, Enumerable.Empty<Type>());
28 return new TypeInfo(current, choices);
68 Value = value ??
throw new ArgumentNullException(nameof(value));
89 public IEnumerable<Error>
Errors {
get; }
99 : base(value, typeInfo) { }
102 : this(value,
TypeInfo.Create(value.GetType())) { }
104#region IEquatable<Parsed<T>> Members
148 return base.Equals(obj);
157 return new {
Tag,
Value }.GetHashCode();
168 : base(errors, typeInfo) { }
170#region IEquatable<NotParsed<T>> Members
214 return base.Equals(obj);
223 return new {
Tag,
Errors }.GetHashCode();
It contains a sequence of CommandLine.Error.
override int GetHashCode()
Serves as a hash function for a particular type.
NotParsed(TypeInfo typeInfo, IEnumerable< Error > errors)
bool Equals(NotParsed< T > other)
Returns a value that indicates whether the current instance and a specified CommandLine....
override bool Equals(object obj)
Determines whether the specified System.Object is equal to the current System.Object.
It contains an instance of type T with parsed values.
override bool Equals(object obj)
Determines whether the specified System.Object is equal to the current System.Object.
bool Equals(Parsed< T > other)
Returns a value that indicates whether the current instance and a specified CommandLine....
override int GetHashCode()
Serves as a hash function for a particular type.
Parsed(T value, TypeInfo typeInfo)
Models a parser result. When inherited by CommandLine.Parsed<T>, it contains an instance of type T w...
ParserResult(T value, TypeInfo typeInfo)
ParserResult(IEnumerable< Error > errors, TypeInfo typeInfo)
IEnumerable< Error > Errors
Gets the sequence of parsing errors. If there are no errors, then an empty IEnumerable is returned.
ParserResultType Tag
Parser result type discriminator, defined as CommandLine.ParserResultType enumeration.
T Value
Gets the instance with parsed values. If one or more errors occures, default is returned.
IEnumerable< Type > Choices
TypeInfo(Type current, IEnumerable< Type > choices)
static TypeInfo Create(Type current, IEnumerable< Type > choices)
static TypeInfo Create(Type current)
ParserResultType
Discriminator enumeration of CommandLine.ParserResultType derivates.