Reflection Class

Summary

Helper class for handling Reflection amd Expression tree related items.
Namespace
ReactiveUI
Base Types
  • object
graph BT Type-->Base0["object"] Type["Reflection"] class Type type-node

Syntax

public static class Reflection

Methods

Name Value Summary
ExpressionToPropertyNames(Expression) string
Will convert a Expression which points towards a property to a string containing the property names. The sub-properties will be separated by the '.' character. Index based values will include [] after the name.
static
GetEventArgsTypeForEvent(Type, string) Type
Gets the appropriate EventArgs derived object for the specified event name for a Type.
static
GetValueFetcherForProperty(MemberInfo) Func<object, object[], object>
Converts a MemberInfo into a Func which will fetch the value for the Member. Handles either fields or properties.
static
GetValueFetcherOrThrow(MemberInfo) Func<object, object[], object>
Converts a MemberInfo into a Func which will fetch the value for the Member. Handles either fields or properties. If there is no field or property with the matching MemberInfo it'll throw an ArgumentException.
static
GetValueSetterForProperty(MemberInfo) Action<object, object, object[]>
Converts a MemberInfo into a Func which will set the value for the Member. Handles either fields or properties. If there is no field or property with the matching MemberInfo it'll throw an ArgumentException.
static
GetValueSetterOrThrow(MemberInfo) Action<object, object, object[]>
Converts a MemberInfo into a Func which will set the value for the Member. Handles either fields or properties. If there is no field or property with the matching MemberInfo it'll throw an ArgumentException.
static
IsStatic(PropertyInfo) bool
Determines if the specified property is static or not.
static
ReallyFindType(string, bool) Type
Gets a Type from the specified type name. Uses a cache to avoid having to use Reflection every time.
static
Rewrite(Expression) Expression
Uses the expression re-writer to simplify the Expression down to it's simplest Expression.
static
ThrowIfMethodsNotOverloaded(string, object, string[]) void
Checks to make sure that the specified method names on the target object are overriden.
static
TryGetAllValuesForPropertyChain(IObservedChange<object, object>[], object, IEnumerable<Expression>) bool
Based on a list of Expressions get a IObservedChanged for the value of the last property in the chain if possible. The Expressions are property chains. Eg Property1.Property2.Property3 The method will make sure that each Expression can get a value along the way and get each property until each expression is evaluated.
static
TryGetValueForPropertyChain<TValue>(TValue, object, IEnumerable<Expression>) bool
Based on a list of Expressions get the value of the last property in the chain if possible. The Expressions are typically property chains. Eg Property1.Property2.Property3 The method will make sure that each Expression can get a value along the way and get each property until each expression is evaluated.
static
TrySetValueToPropertyChain<TValue>(object, IEnumerable<Expression>, TValue, bool) bool
Based on a list of Expressions set a value of the last property in the chain if possible. The Expressions are property chains. Eg Property1.Property2.Property3 The method will make sure that each Expression can use each value along the way and set the last value.
static