Class ReflectionDelegateFactory
A factory service which gets an accessor function via reflection.
Inheritance
Inherited Members
Namespace: CSF.Validation.ManifestModel
Assembly: CSF.Validation.dll
Syntax
public class ReflectionDelegateFactory : IGetsAccessorFunction, IGetsPropertySetterAction
Methods
| Improve this Doc View SourceGetAccessorFunction(Type, String)
Gets the accessor function which corresponds to getting a value from the
specified type
by using the specified memberName
.
Declaration
public AccessorFunctionAndType GetAccessorFunction(Type type, string memberName)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type of object which shall be the input to the function. |
System.String | memberName | The name of the member to get/access/execute in order to get the output of the function. |
Returns
Type | Description |
---|---|
AccessorFunctionAndType | An AccessorFunctionAndType containing both the function and also the expected return-type of that function. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If either |
System.ArgumentException | If either the |
GetSetterAction(Type, String)
Gets the action delegate which may be used to set the property value. The first parameter of the delegate is the target object and the second parameter is the property value to set.
Declaration
public Action<object, object> GetSetterAction(Type type, string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type of object for which to set the property value. |
System.String | propertyName | The name of the property to set. |
Returns
Type | Description |
---|---|
System.Action<System.Object, System.Object> | An action delegate. |