Interface IConfigurableParser<TResult, TOptions>
Defines methods that converts a string to a generic object of TResult.
public interface IConfigurableParser<TResult, out TOptions> where TOptions : class, new()
Type Parameters
TResultThe type of the converted result.
TOptionsThe type of the delegate setup.
Methods
Parse(string, Action<TOptions>)
Converts the input to its TResult equivalent.
TResult Parse(string input, Action<out TOptions> setup = null)
Parameters
Returns
- TResult
A
TResultequivalent toinput.
TryParse(string, out TResult, Action<TOptions>)
Converts the input to its TResult equivalent. A return input indicates whether the conversion succeeded.
bool TryParse(string input, out TResult result, Action<out TOptions> setup = null)
Parameters
inputstringThe string to convert.
resultTResultWhen this method returns, contains the
TResultequivalent of theinput, if the conversion succeeded, ordefaultif the conversion failed.setupAction<TOptions>The
TOptionswhich may be configured.
Returns
- bool
trueifinputwas converted successfully; otherwise,false.