Show / Hide Table of Contents

Class ReflectionDelegateFactory

A factory service which gets an accessor function via reflection.

Inheritance
System.Object
ReflectionDelegateFactory
Implements
IGetsAccessorFunction
IGetsPropertySetterAction
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CSF.Validation.ManifestModel
Assembly: CSF.Validation.dll
Syntax
public class ReflectionDelegateFactory : IGetsAccessorFunction, IGetsPropertySetterAction

Methods

| Improve this Doc View Source

GetAccessorFunction(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 memberName or type are null.

System.ArgumentException

If either the type does not have an accessible member named memberName or if that member has a langword_csharp_void return-type.

| Improve this Doc View Source

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.

Implements

IGetsAccessorFunction
IGetsPropertySetterAction
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX