Class ReactiveExpressionServices
Provides a set of services for expression tree manipulation in reactive processing implementations.
Inheritance
Implements
Namespace: Reaqtor
Assembly: Reaqtor.Shared.Core.dll
Syntax
public class ReactiveExpressionServices : Object, IReactiveExpressionServices
Constructors
ReactiveExpressionServices(Type)
Creates a new expression service provider instance.
Declaration
public ReactiveExpressionServices(Type reactiveClientInterfaceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reactiveClientInterfaceType | Interface type of the IReactiveClient variant used to obtain reactive resources. |
Methods
Funcletize(Expression)
Locally evaluates any unsupported constructs in the expression (such as closures, disallowed methods, etc.) by turning them into funclet expressions. This rewrite gets called prior to further rewrite stages that normalize the expression tree.
Declaration
protected virtual Expression Funcletize(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression | Expression tree to scan for constructs that need to be funcletized. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | Expression with unsupported constructs rewritten into funclets. |
GetKnownResourceInvocation(Uri, MemberInfo, Expression, IEnumerable<Expression>, Type)
Gets an expression representing the invocation of a known resource.
Declaration
protected virtual Expression GetKnownResourceInvocation(Uri knownResourceUri, MemberInfo member, Expression instance, IEnumerable<Expression> arguments, Type returnType)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | knownResourceUri | URI of the known resource. |
System.Reflection.MemberInfo | member | Member annotated with the KnownResource attribute, targeted by this rewrite. |
System.Linq.Expressions.Expression | instance | Instance to invoke the member on (if any). |
System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> | arguments | Arguments to pass to the member invocation (if any). |
System.Type | returnType | Return type of the known resource expression. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | Expression representing the invocation of a known resource. |
GetNamedExpression(Type, Uri)
Gets an expression representing a named resource.
Declaration
public virtual Expression GetNamedExpression(Type type, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Type of the resource. |
System.Uri | uri | Name of the resource. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | Expression representing the named resource. |
Normalize(Expression)
Normalizes the specified expression. This method is typically used to process expressions prior to further processing by a service.
Declaration
public virtual Expression Normalize(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression | Expression to normalize. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | Normalized expression. |
RegisterObject(Object, Expression)
Registers an association of an object to its expression representation.
Declaration
public virtual void RegisterObject(object value, Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Object to associate with an expression representation. |
System.Linq.Expressions.Expression | expression | Expression representation of the object. |
TryGetName(Expression, out Uri)
Tries to extract the name of a resource from its expression representation.
Declaration
public virtual bool TryGetName(Expression expression, out Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression | Expression to extract a name from. |
System.Uri | uri | Name of the resource, if found. |
Returns
Type | Description |
---|---|
System.Boolean | true if the expression represents a named resource; otherwise, false. |
TryGetObject(Object, out Expression)
Tries to find an association of the specified object to an expression representation.
Declaration
public virtual bool TryGetObject(object value, out Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Object to find an associated expression representation for. |
System.Linq.Expressions.Expression | expression | Expression representation of the object, if found. |
Returns
Type | Description |
---|---|
System.Boolean | true if an association was found; otherwise, false. |