Class Option<TValue>
Option subclass that defines the type of the Option value.
Inheritance
System.Object
Option<TValue>
Inherited Members
Namespace: sttz.Trimmer
Assembly: Trimmer.dll
Syntax
public abstract class Option<TValue> : Option
Type Parameters
Name | Description |
---|---|
TValue |
Remarks
This subclass is mostly an informal standard, adopted by all subclasses in sttz.Trimmer.BaseOptions but not actually used in the rest of Trimmer's code.
Properties
| Improve this Doc View SourceDefaultValue
The default value, used when input is empty or invalid.
Declaration
public TValue DefaultValue { get; protected set; }
Property Value
Type | Description |
---|---|
TValue |
Value
The typed value of the Option.
Declaration
public TValue Value { get; set; }
Property Value
Type | Description |
---|---|
TValue |
Methods
| Improve this Doc View SourceParse(String)
Parse a string value to the Option Value's type.
Declaration
public abstract TValue Parse(string input)
Parameters
Type | Name | Description |
---|---|---|
System.String | input |
Returns
Type | Description |
---|---|
TValue |
Remarks
If the input is empty or parsing fails, DefaultValue should be returned.
Save(TValue)
Serialize a typed value to a string.
Declaration
public abstract string Save(TValue input)
Parameters
Type | Name | Description |
---|---|---|
TValue | input |
Returns
Type | Description |
---|---|
System.String |
Remarks
The string returned by Save can later be fed back to Parse(String) and should survive the round-trip without loss.