Interface IConfigurableParser<TOptions>
public interface IConfigurableParser<out TOptions> where TOptions : class, IParameterObject, new()
Type Parameters
TOptions
The type of the delegate setup.
Methods
Parse(string, Type, Action<TOptions>)
Converts the specified input
to an object of targetType
.
object Parse(string input, Type targetType, Action<out TOptions> setup = null)
Parameters
input
stringThe string to convert.
targetType
TypeThe type of the object to return.
setup
Action<TOptions>The
TOptions
which may be configured.
Returns
- object
An object of
targetType
equivalent toinput
.
Parse<T>(string, Action<TOptions>)
Converts the specified input
to an object of T
.
T Parse<T>(string input, Action<out TOptions> setup = null)
Parameters
Returns
- T
An object of
T
equivalent toinput
.
Type Parameters
T
The type of the object to return.
TryParse(string, Type, out object, Action<TOptions>)
Converts the specified input
to an object of targetType
. A return value indicates whether the conversion succeeded.
bool TryParse(string input, Type targetType, out object result, Action<out TOptions> setup = null)
Parameters
input
stringThe string to convert.
targetType
TypeThe type of the object to return.
result
objectWhen this method returns, contains the object of
targetType
equivalent toinput
, if the conversion succeeded, ordefault
if the conversion failed.setup
Action<TOptions>The
TOptions
which may be configured.
Returns
- bool
true
ifinput
was converted successfully; otherwise,false
.
TryParse<T>(string, out T, Action<TOptions>)
Converts the specified input
to an object of T
. A return value indicates whether the conversion succeeded.
bool TryParse<T>(string input, out T result, Action<out TOptions> setup = null)
Parameters
input
stringThe string to convert.
result
TWhen this method returns, contains the object of
T
equivalent toinput
, if the conversion succeeded, ordefault
if the conversion failed.setup
Action<TOptions>The
TOptions
which may be configured.
Returns
- bool
true
ifinput
was converted successfully; otherwise,false
.
Type Parameters
T
The type of the object to return.