Joutsen.ArgumentsParsing  v0.2.1
Public Member Functions | List of all members
Joutsen.ArgumentsParsing.TargetPropertyAccessor Class Reference

A utility class that uses reflection to set the parsed values on the properties of a target instance. More...

Public Member Functions

PropertyInfo GetParseResultAttributedProperty (string name, object target)
 Fetches the property that has the ParseTargetPropertyAttribute with the name from the target. More...
 
PropertyInfo GetPropertyByName (string name, object target)
 Fetches the property with the name from the target. More...
 
object GetTargetPropertyValue (string name, object target)
 Fetches the value of a property that is a target for a parsed value. More...
 
bool SetTargetProperty (string name, object target, object value)
 Sets a parsed value on a target instance. More...
 

Detailed Description

A utility class that uses reflection to set the parsed values on the properties of a target instance.

Since
0.1.0

Member Function Documentation

◆ GetParseResultAttributedProperty()

PropertyInfo Joutsen.ArgumentsParsing.TargetPropertyAccessor.GetParseResultAttributedProperty ( string  name,
object  target 
)

Fetches the property that has the ParseTargetPropertyAttribute with the name from the target.

Parameters
namethe argument name
targetthe instance from which to fetch the property
theproperty

◆ GetPropertyByName()

PropertyInfo Joutsen.ArgumentsParsing.TargetPropertyAccessor.GetPropertyByName ( string  name,
object  target 
)

Fetches the property with the name from the target.

Parameters
namethe argument/property name
targetthe instance from which to fetch the property
theproperty

◆ GetTargetPropertyValue()

object Joutsen.ArgumentsParsing.TargetPropertyAccessor.GetTargetPropertyValue ( string  name,
object  target 
)

Fetches the value of a property that is a target for a parsed value.

Parameters
namethe argument/property name
targetthe instance from which to fetch the property value
Returns
the value of the property

◆ SetTargetProperty()

bool Joutsen.ArgumentsParsing.TargetPropertyAccessor.SetTargetProperty ( string  name,
object  target,
object  value 
)

Sets a parsed value on a target instance.

Parameters
namethe argument/property name
targetthe instance from which to fetch the property value
valuethe parsed value
Returns
true if the parsed value was set on the target, otherwise false