Show / Hide Table of Contents

Class ExpressionVisitorWithReflection

Expression visitor with visit methods for reflection objects.

Inheritance
System.Object
ScopedExpressionVisitorBase
ScopedExpressionVisitor<System.Linq.Expressions.ParameterExpression>
ExpressionVisitorWithReflection
TypeSubstitutionExpressionVisitor
Inherited Members
ScopedExpressionVisitor<ParameterExpression>.TryLookup(ParameterExpression, ParameterExpression)
ScopedExpressionVisitor<ParameterExpression>.Push(IEnumerable<ParameterExpression>)
ScopedExpressionVisitor<ParameterExpression>.Push(IEnumerable<KeyValuePair<ParameterExpression, ParameterExpression>>)
ScopedExpressionVisitor<ParameterExpression>.Pop()
ScopedExpressionVisitor<ParameterExpression>.GlobalScope
ScopedExpressionVisitorBase.VisitBlock(BlockExpression)
ScopedExpressionVisitorBase.VisitCatchBlock(CatchBlock)
ScopedExpressionVisitorBase.VisitLambda<T>(Expression<T>)
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class ExpressionVisitorWithReflection : ScopedExpressionVisitor<ParameterExpression>

Constructors

ExpressionVisitorWithReflection()

Creates a new expression visitor instance.

Declaration
public ExpressionVisitorWithReflection()

Methods

GetState(ParameterExpression)

Maps a parameter declaration onto a new parameter expression if the visited type is different from the original type.

Declaration
protected override sealed ParameterExpression GetState(ParameterExpression parameter)
Parameters
Type Name Description
System.Linq.Expressions.ParameterExpression parameter

Parameter declaration to visit.

Returns
Type Description
System.Linq.Expressions.ParameterExpression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

Overrides
System.Linq.CompilerServices.ScopedExpressionVisitor<System.Linq.Expressions.ParameterExpression>.GetState(System.Linq.Expressions.ParameterExpression)

MakeBinary(ExpressionType, Expression, Expression, Boolean, MethodInfo, LambdaExpression)

Creates a binary expression.

Declaration
protected virtual Expression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method, LambdaExpression conversion)
Parameters
Type Name Description
System.Linq.Expressions.ExpressionType binaryType

Binary expression node type.

System.Linq.Expressions.Expression left

Left operand.

System.Linq.Expressions.Expression right

Right operand.

System.Boolean liftToNull

Indicates whether the operator is lifted.

System.Reflection.MethodInfo method

Method implementing the operation.

System.Linq.Expressions.LambdaExpression conversion

Type conversion function for coalescing and compound assignment operations.

Returns
Type Description
System.Linq.Expressions.Expression

New binary expression node.

MakeBlock(Type, IEnumerable<ParameterExpression>, IEnumerable<Expression>)

Creates a block expression.

Declaration
protected virtual Expression MakeBlock(Type type, IEnumerable<ParameterExpression> variables, IEnumerable<Expression> expressions)
Parameters
Type Name Description
System.Type type

Result type of the block expression.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.ParameterExpression> variables

Variables in scope in the block expression.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> expressions

Expressions in the body of the block expression.

Returns
Type Description
System.Linq.Expressions.Expression

New block expression node.

MakeCatchBlock(Type, ParameterExpression, Expression, Expression)

Creates a catch block.

Declaration
protected virtual CatchBlock MakeCatchBlock(Type test, ParameterExpression variable, Expression body, Expression filter)
Parameters
Type Name Description
System.Type test

Type of the exception to catch.

System.Linq.Expressions.ParameterExpression variable

Variable for the exception being handled by the catch block.

System.Linq.Expressions.Expression body

Body of the catch block.

System.Linq.Expressions.Expression filter

Filter condition for exceptions handled by the catch block.

Returns
Type Description
System.Linq.Expressions.CatchBlock

New catch block node.

MakeConditional(Expression, Expression, Expression, Type)

Creates a conditional expression.

Declaration
protected virtual Expression MakeConditional(Expression test, Expression ifTrue, Expression ifFalse, Type type)
Parameters
Type Name Description
System.Linq.Expressions.Expression test

Expression to test the condition.

System.Linq.Expressions.Expression ifTrue

Result expression when the condition evaluates to true.

System.Linq.Expressions.Expression ifFalse

Result expression when the condition evaluates to false.

System.Type type

Result type of the conditional expression.

Returns
Type Description
System.Linq.Expressions.Expression

New conditional expression node.

MakeConstant(Object, Type)

Creates a constant expression.

Declaration
protected virtual Expression MakeConstant(object value, Type type)
Parameters
Type Name Description
System.Object value

Value of the constant expression.

System.Type type

Type of the constant expression.

Returns
Type Description
System.Linq.Expressions.Expression

New constant expression node.

MakeDefault(Type)

Creates a default expression.

Declaration
protected virtual Expression MakeDefault(Type type)
Parameters
Type Name Description
System.Type type

Type of the default expression.

Returns
Type Description
System.Linq.Expressions.Expression

New default expression node.

MakeDynamic(CallSiteBinder, Type, IEnumerable<Expression>)

Creates a dynamic expression.

Declaration
protected virtual Expression MakeDynamic(CallSiteBinder binder, Type returnType, IEnumerable<Expression> arguments)
Parameters
Type Name Description
System.Runtime.CompilerServices.CallSiteBinder binder

Binder to evaluate the dynamic expression.

System.Type returnType

Return type of the dynamic expression.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the dynamic expression.

Returns
Type Description
System.Linq.Expressions.Expression

New dynamic expression node.

MakeElementInit(MethodInfo, IEnumerable<Expression>)

Creates an element initializer node.

Declaration
protected virtual ElementInit MakeElementInit(MethodInfo addMethod, IEnumerable<Expression> arguments)
Parameters
Type Name Description
System.Reflection.MethodInfo addMethod

Method to add the element to the collection.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the add method.

Returns
Type Description
System.Linq.Expressions.ElementInit

New element initializer node.

MakeGoto(GotoExpressionKind, LabelTarget, Expression, Type)

Creates a goto expression.

Declaration
protected virtual Expression MakeGoto(GotoExpressionKind kind, LabelTarget target, Expression value, Type type)
Parameters
Type Name Description
System.Linq.Expressions.GotoExpressionKind kind

Kind of the goto expression.

System.Linq.Expressions.LabelTarget target

Label to jump to.

System.Linq.Expressions.Expression value

Value to transfer to the jump label.

System.Type type

Type of the value transferred to the jump label.

Returns
Type Description
System.Linq.Expressions.Expression

New goto expression node.

MakeIndex(Expression, PropertyInfo, IEnumerable<Expression>)

Creates an index expression.

Declaration
protected virtual Expression MakeIndex(Expression instance, PropertyInfo indexer, IEnumerable<Expression> arguments)
Parameters
Type Name Description
System.Linq.Expressions.Expression instance

Expression of the instance to index into.

System.Reflection.PropertyInfo indexer

Indexer to invoke.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the indexer.

Returns
Type Description
System.Linq.Expressions.Expression

New index expression node.

MakeInvocation(Expression, IEnumerable<Expression>)

Creates an invocation expression.

Declaration
protected virtual Expression MakeInvocation(Expression expression, IEnumerable<Expression> arguments)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

Expression of the function to invoke.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the invocation.

Returns
Type Description
System.Linq.Expressions.Expression

New invocation expression node.

MakeLabel(LabelTarget, Expression)

Creates a label expression.

Declaration
protected virtual Expression MakeLabel(LabelTarget target, Expression defaultValue)
Parameters
Type Name Description
System.Linq.Expressions.LabelTarget target

Target label associated with the label expression.

System.Linq.Expressions.Expression defaultValue

Default value of the label to use in case a goto expression doesn't carry a value.

Returns
Type Description
System.Linq.Expressions.Expression

New label expression node.

MakeLabelTarget(Type, String)

Creates a label target.

Declaration
protected virtual LabelTarget MakeLabelTarget(Type type, string name)
Parameters
Type Name Description
System.Type type

Type of values received by jumps to the label.

System.String name

Name of the label.

Returns
Type Description
System.Linq.Expressions.LabelTarget

New label target.

MakeLambda(Type, Expression, String, Boolean, IEnumerable<ParameterExpression>)

Creates a lambda expression.

Declaration
protected virtual Expression MakeLambda(Type delegateType, Expression body, string name, bool tailCall, IEnumerable<ParameterExpression> parameters)
Parameters
Type Name Description
System.Type delegateType

Delegate type to use for lambda expression creation.

System.Linq.Expressions.Expression body

Body of the lambda expression.

System.String name

Name of the lambda expression.

System.Boolean tailCall

Indicates whether the lambda expression should be optimized for tail calls.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.ParameterExpression> parameters

Parameters of the lambda expression.

Returns
Type Description
System.Linq.Expressions.Expression

New lambda expression node.

MakeListInit(NewExpression, IEnumerable<ElementInit>)

Creates a list initializer expression.

Declaration
protected virtual Expression MakeListInit(NewExpression newExpression, IEnumerable<ElementInit> initializers)
Parameters
Type Name Description
System.Linq.Expressions.NewExpression newExpression

List instance creation expression.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.ElementInit> initializers

Element initializers.

Returns
Type Description
System.Linq.Expressions.Expression

New list initializer expression node.

MakeLoop(Expression, LabelTarget, LabelTarget)

Creates a loop expression.

Declaration
protected virtual Expression MakeLoop(Expression body, LabelTarget break, LabelTarget continue)
Parameters
Type Name Description
System.Linq.Expressions.Expression body

Body of the loop.

System.Linq.Expressions.LabelTarget break

Label to jump to upon breaking from the loop.

System.Linq.Expressions.LabelTarget continue

Label to jump to upon continuing to the next loop iteration.

Returns
Type Description
System.Linq.Expressions.Expression

New loop expression node.

MakeMember(Expression, MemberInfo)

Creates a member expression.

Declaration
protected virtual Expression MakeMember(Expression expression, MemberInfo member)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

Expression to obtain the member value from.

System.Reflection.MemberInfo member

Member to invoke.

Returns
Type Description
System.Linq.Expressions.Expression

New member expression node.

MakeMemberAssignment(MemberInfo, Expression)

Creates a member assignment node.

Declaration
protected virtual MemberAssignment MakeMemberAssignment(MemberInfo member, Expression expression)
Parameters
Type Name Description
System.Reflection.MemberInfo member

Member to assign to.

System.Linq.Expressions.Expression expression

Expression to assign to the member.

Returns
Type Description
System.Linq.Expressions.MemberAssignment

New member assignment node.

MakeMemberInit(NewExpression, IEnumerable<MemberBinding>)

Creates a member initialization expression.

Declaration
protected virtual Expression MakeMemberInit(NewExpression newExpression, IEnumerable<MemberBinding> bindings)
Parameters
Type Name Description
System.Linq.Expressions.NewExpression newExpression

Object instance creation expression.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.MemberBinding> bindings

Member bindings.

Returns
Type Description
System.Linq.Expressions.Expression

New member initialization expression node.

MakeMemberListBinding(MemberInfo, IEnumerable<ElementInit>)

Creates a member list binding node.

Declaration
protected virtual MemberListBinding MakeMemberListBinding(MemberInfo member, IEnumerable<ElementInit> initializers)
Parameters
Type Name Description
System.Reflection.MemberInfo member

Member to apply list bindings to.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.ElementInit> initializers

Element initializers.

Returns
Type Description
System.Linq.Expressions.MemberListBinding

New member list binding node.

MakeMemberMemberBinding(MemberInfo, IEnumerable<MemberBinding>)

Creates a member binding node.

Declaration
protected virtual MemberMemberBinding MakeMemberMemberBinding(MemberInfo member, IEnumerable<MemberBinding> bindings)
Parameters
Type Name Description
System.Reflection.MemberInfo member

Member to apply member bindings to.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.MemberBinding> bindings

Member bindings.

Returns
Type Description
System.Linq.Expressions.MemberMemberBinding

New member binding node.

MakeMethodCall(Expression, MethodInfo, IEnumerable<Expression>)

Creates a method call expression.

Declaration
protected virtual Expression MakeMethodCall(Expression instance, MethodInfo method, IEnumerable<Expression> arguments)
Parameters
Type Name Description
System.Linq.Expressions.Expression instance

Instance to call the method on.

System.Reflection.MethodInfo method

Method to call.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the method call.

Returns
Type Description
System.Linq.Expressions.Expression

New method call expression node.

MakeNew(ConstructorInfo, IEnumerable<Expression>, IEnumerable<MemberInfo>)

Creates a new expression.

Declaration
protected virtual Expression MakeNew(ConstructorInfo constructor, IEnumerable<Expression> arguments, IEnumerable<MemberInfo> members)
Parameters
Type Name Description
System.Reflection.ConstructorInfo constructor

Constructor to call.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments

Arguments to pass to the constructor.

System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo> members

Members initialized by the arguments passed to the constructor.

Returns
Type Description
System.Linq.Expressions.Expression

New new expression node.

MakeNew(Type)

Creates a new expression.

Declaration
protected virtual Expression MakeNew(Type type)
Parameters
Type Name Description
System.Type type

The new type to use.

Returns
Type Description
System.Linq.Expressions.Expression

New new expression node.

MakeNewArray(ExpressionType, Type, IEnumerable<Expression>)

Creates a new array expression.

Declaration
protected virtual Expression MakeNewArray(ExpressionType newArrayType, Type type, IEnumerable<Expression> expressions)
Parameters
Type Name Description
System.Linq.Expressions.ExpressionType newArrayType

Array creation expression node type.

System.Type type

Element type of the array.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> expressions

Expression used for array bounds or element initializers.

Returns
Type Description
System.Linq.Expressions.Expression

New new array expression node.

MakeRuntimeVariables(IEnumerable<ParameterExpression>)

Creates a runtime variables expression.

Declaration
protected virtual Expression MakeRuntimeVariables(IEnumerable<ParameterExpression> variables)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Linq.Expressions.ParameterExpression> variables

Variables to populate the runtime variables collection.

Returns
Type Description
System.Linq.Expressions.Expression

New runtime variables expression node.

MakeSwitch(Type, Expression, Expression, MethodInfo, IEnumerable<SwitchCase>)

Creates a switch expression.

Declaration
protected virtual Expression MakeSwitch(Type type, Expression switchValue, Expression defaultBody, MethodInfo comparison, IEnumerable<SwitchCase> cases)
Parameters
Type Name Description
System.Type type

Result type of the switch expression.

System.Linq.Expressions.Expression switchValue

Value to switch on.

System.Linq.Expressions.Expression defaultBody

Body of the default label.

System.Reflection.MethodInfo comparison

Method to use for comparison operations.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.SwitchCase> cases

Switch cases.

Returns
Type Description
System.Linq.Expressions.Expression

New switch expression node.

MakeSwitchCase(Expression, IEnumerable<Expression>)

Creates a switch case node.

Declaration
protected virtual SwitchCase MakeSwitchCase(Expression body, IEnumerable<Expression> testValues)
Parameters
Type Name Description
System.Linq.Expressions.Expression body

Body of the switch case.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> testValues

Test values of the switch case.

Returns
Type Description
System.Linq.Expressions.SwitchCase

New switch case node.

MakeTry(Type, Expression, Expression, Expression, IEnumerable<CatchBlock>)

Creates a try expression.

Declaration
protected virtual Expression MakeTry(Type type, Expression body, Expression finally, Expression fault, IEnumerable<CatchBlock> handlers)
Parameters
Type Name Description
System.Type type

Result type of the try expression.

System.Linq.Expressions.Expression body

Body of the try expression.

System.Linq.Expressions.Expression finally

Finally block.

System.Linq.Expressions.Expression fault

Fault handler.

System.Collections.Generic.IEnumerable<System.Linq.Expressions.CatchBlock> handlers

Catch blocks.

Returns
Type Description
System.Linq.Expressions.Expression

New try expression node.

MakeTypeBinary(ExpressionType, Expression, Type)

Creates a type binary expression.

Declaration
protected virtual Expression MakeTypeBinary(ExpressionType typeBinaryType, Expression expression, Type typeOperand)
Parameters
Type Name Description
System.Linq.Expressions.ExpressionType typeBinaryType

Type binary expression node type.

System.Linq.Expressions.Expression expression

Expression to apply the type binary operation to.

System.Type typeOperand

Type operand of the type binary operation.

Returns
Type Description
System.Linq.Expressions.Expression

New type binary expression node.

MakeUnary(ExpressionType, Expression, Type, MethodInfo)

Creates a unary expression.

Declaration
protected virtual Expression MakeUnary(ExpressionType unaryType, Expression operand, Type type, MethodInfo method)
Parameters
Type Name Description
System.Linq.Expressions.ExpressionType unaryType

Unary expression node type.

System.Linq.Expressions.Expression operand

Operand of the unary expression.

System.Type type

Type used for conversion operations.

System.Reflection.MethodInfo method

Method implementing the operation.

Returns
Type Description
System.Linq.Expressions.Expression

New unary expression node.

VisitBinary(BinaryExpression)

Visits the children of a binary expression.

Declaration
protected override Expression VisitBinary(BinaryExpression node)
Parameters
Type Name Description
System.Linq.Expressions.BinaryExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitBinder(CallSiteBinder)

Visits a call site binder.

Declaration
protected virtual CallSiteBinder VisitBinder(CallSiteBinder binder)
Parameters
Type Name Description
System.Runtime.CompilerServices.CallSiteBinder binder

Call site binder to visit.

Returns
Type Description
System.Runtime.CompilerServices.CallSiteBinder

Result of the visit.

VisitBlockCore(BlockExpression)

Visits the children of a block expression.

Declaration
protected override Expression VisitBlockCore(BlockExpression node)
Parameters
Type Name Description
System.Linq.Expressions.BlockExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

Overrides
ScopedExpressionVisitorBase.VisitBlockCore(BlockExpression)

VisitCatchBlockCore(CatchBlock)

Visits the children of a catch block node.

Declaration
protected override CatchBlock VisitCatchBlockCore(CatchBlock node)
Parameters
Type Name Description
System.Linq.Expressions.CatchBlock node

The catch block to visit.

Returns
Type Description
System.Linq.Expressions.CatchBlock

The modified catch block, if it or any subexpression was modified; otherwise, returns the original catch block.

Overrides
ScopedExpressionVisitorBase.VisitCatchBlockCore(CatchBlock)

VisitConditional(ConditionalExpression)

Visits the children of a conditional expression.

Declaration
protected override Expression VisitConditional(ConditionalExpression node)
Parameters
Type Name Description
System.Linq.Expressions.ConditionalExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitConstant(ConstantExpression)

Visits the constant expression.

Declaration
protected override Expression VisitConstant(ConstantExpression node)
Parameters
Type Name Description
System.Linq.Expressions.ConstantExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitConstructor(ConstructorInfo)

Visits a constructor. When overridden, other reflection object visit methods should be overridden appropriately to ensure consistent typing.

Declaration
protected virtual ConstructorInfo VisitConstructor(ConstructorInfo constructor)
Parameters
Type Name Description
System.Reflection.ConstructorInfo constructor

Constructor to visit.

Returns
Type Description
System.Reflection.ConstructorInfo

Result of the visit.

VisitDefault(DefaultExpression)

Visits the default expression.

Declaration
protected override Expression VisitDefault(DefaultExpression node)
Parameters
Type Name Description
System.Linq.Expressions.DefaultExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitDynamic(DynamicExpression)

Visits the children of a dynamic expression.

Declaration
protected override Expression VisitDynamic(DynamicExpression node)
Parameters
Type Name Description
System.Linq.Expressions.DynamicExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitElementInit(ElementInit)

Visits the children of an element initializer node.

Declaration
protected override ElementInit VisitElementInit(ElementInit node)
Parameters
Type Name Description
System.Linq.Expressions.ElementInit node

The element initializer to visit.

Returns
Type Description
System.Linq.Expressions.ElementInit

The modified element initializer, if it or any subexpression was modified; otherwise, returns the original element initializer.

VisitGoto(GotoExpression)

Visits the children of a goto expression.

Declaration
protected override Expression VisitGoto(GotoExpression node)
Parameters
Type Name Description
System.Linq.Expressions.GotoExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitIfNotNull<T>(T, Func<T, T>)

Visits the specified node using the specified visitor function if it's not null.

Declaration
protected static T VisitIfNotNull<T>(T node, Func<T, T> nodeVisitor)
Parameters
Type Name Description
T node

Node to visit.

System.Func<T, T> nodeVisitor

Visitor function to apply to the node.

Returns
Type Description
T

Result of applying the visitor function to the node.

Type Parameters
Name Description
T

Type of the node to visit.

VisitIndex(IndexExpression)

Visits the children of an index expression.

Declaration
protected override Expression VisitIndex(IndexExpression node)
Parameters
Type Name Description
System.Linq.Expressions.IndexExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitInvocation(InvocationExpression)

Visits the children of an invocation expression.

Declaration
protected override Expression VisitInvocation(InvocationExpression node)
Parameters
Type Name Description
System.Linq.Expressions.InvocationExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitLabel(LabelExpression)

Visits the children of a label expression.

Declaration
protected override Expression VisitLabel(LabelExpression node)
Parameters
Type Name Description
System.Linq.Expressions.LabelExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitLabelTarget(LabelTarget)

Visits the children of a label target node.

Declaration
protected override LabelTarget VisitLabelTarget(LabelTarget node)
Parameters
Type Name Description
System.Linq.Expressions.LabelTarget node

The label target to visit.

Returns
Type Description
System.Linq.Expressions.LabelTarget

The modified label target, if it or any subexpression was modified; otherwise, returns the original label target.

VisitLambdaCore<T>(Expression<T>)

Visits the children of a lambda expression.

Declaration
protected override Expression VisitLambdaCore<T>(Expression<T> node)
Parameters
Type Name Description
System.Linq.Expressions.Expression<T> node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

Type Parameters
Name Description
T

The type of the delegate.

Overrides
System.Linq.CompilerServices.ScopedExpressionVisitorBase.VisitLambdaCore<T>(System.Linq.Expressions.Expression<T>)

VisitListInit(ListInitExpression)

Visits the children of a list initializer expression.

Declaration
protected override Expression VisitListInit(ListInitExpression node)
Parameters
Type Name Description
System.Linq.Expressions.ListInitExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitLoop(LoopExpression)

Visits the children of a loop expression.

Declaration
protected override Expression VisitLoop(LoopExpression node)
Parameters
Type Name Description
System.Linq.Expressions.LoopExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitMember(MemberExpression)

Visits the children of a member expression.

Declaration
protected override Expression VisitMember(MemberExpression node)
Parameters
Type Name Description
System.Linq.Expressions.MemberExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitMember(MemberInfo)

Visits a member. When overridden, other reflection object visit methods should be overridden appropriately to ensure consistent typing.

Declaration
protected virtual MemberInfo VisitMember(MemberInfo member)
Parameters
Type Name Description
System.Reflection.MemberInfo member

Member to visit.

Returns
Type Description
System.Reflection.MemberInfo

Result of the visit.

VisitMemberAssignment(MemberAssignment)

Visits the children of a member assignment node.

Declaration
protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
Parameters
Type Name Description
System.Linq.Expressions.MemberAssignment node

The member assignment to visit.

Returns
Type Description
System.Linq.Expressions.MemberAssignment

The modified member assignment, if it or any subexpression was modified; otherwise, returns the original member assignment.

VisitMemberInit(MemberInitExpression)

Visits the children of a member initialization expression.

Declaration
protected override Expression VisitMemberInit(MemberInitExpression node)
Parameters
Type Name Description
System.Linq.Expressions.MemberInitExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitMemberListBinding(MemberListBinding)

Visits the children of a member list binding node.

Declaration
protected override MemberListBinding VisitMemberListBinding(MemberListBinding node)
Parameters
Type Name Description
System.Linq.Expressions.MemberListBinding node

The list binding to visit.

Returns
Type Description
System.Linq.Expressions.MemberListBinding

The modified list binding, if it or any subexpression was modified; otherwise, returns the original list binding.

VisitMemberMemberBinding(MemberMemberBinding)

Visits the children of a member binding node.

Declaration
protected override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
Parameters
Type Name Description
System.Linq.Expressions.MemberMemberBinding node

The member binding to visit.

Returns
Type Description
System.Linq.Expressions.MemberMemberBinding

The modified member binding, if it or any subexpression was modified; otherwise, returns the original member binding.

VisitMethod(MethodInfo)

Visits a method. When overridden, other reflection object visit methods should be overridden appropriately to ensure consistent typing.

Declaration
protected virtual MethodInfo VisitMethod(MethodInfo method)
Parameters
Type Name Description
System.Reflection.MethodInfo method

Method to visit.

Returns
Type Description
System.Reflection.MethodInfo

Result of the visit.

VisitMethodCall(MethodCallExpression)

Visits the children of a method call expression.

Declaration
protected override Expression VisitMethodCall(MethodCallExpression node)
Parameters
Type Name Description
System.Linq.Expressions.MethodCallExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitNew(NewExpression)

Visits the children of a new expression.

Declaration
protected override Expression VisitNew(NewExpression node)
Parameters
Type Name Description
System.Linq.Expressions.NewExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitNewArray(NewArrayExpression)

Visits the children of a new array expression.

Declaration
protected override Expression VisitNewArray(NewArrayExpression node)
Parameters
Type Name Description
System.Linq.Expressions.NewArrayExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitParameter(ParameterExpression)

Visits a parameter expression.

Declaration
protected override Expression VisitParameter(ParameterExpression node)
Parameters
Type Name Description
System.Linq.Expressions.ParameterExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitProperty(PropertyInfo)

Visits a property. When overridden, other reflection object visit methods should be overridden appropriately to ensure consistent typing.

Declaration
protected virtual MemberInfo VisitProperty(PropertyInfo property)
Parameters
Type Name Description
System.Reflection.PropertyInfo property

Property to visit.

Returns
Type Description
System.Reflection.MemberInfo

Result of the visit.

VisitRuntimeVariables(RuntimeVariablesExpression)

Visits the children of a runtime variables expression.

Declaration
protected override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
Parameters
Type Name Description
System.Linq.Expressions.RuntimeVariablesExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitSwitch(SwitchExpression)

Visits the children of a switch expression.

Declaration
protected override Expression VisitSwitch(SwitchExpression node)
Parameters
Type Name Description
System.Linq.Expressions.SwitchExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitSwitchCase(SwitchCase)

Visits the children of a switch case node.

Declaration
protected override SwitchCase VisitSwitchCase(SwitchCase node)
Parameters
Type Name Description
System.Linq.Expressions.SwitchCase node

The switch case to visit.

Returns
Type Description
System.Linq.Expressions.SwitchCase

The modified switch case, if it or any subexpression was modified; otherwise, returns the original switch case.

VisitTry(TryExpression)

Visits the children of a try expression.

Declaration
protected override Expression VisitTry(TryExpression node)
Parameters
Type Name Description
System.Linq.Expressions.TryExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitType(Type)

Visits a type. When overridden, other reflection object visit methods should be overridden appropriately to ensure consistent typing.

Declaration
protected virtual Type VisitType(Type type)
Parameters
Type Name Description
System.Type type

Type to visit.

Returns
Type Description
System.Type

Result of the visit.

VisitTypeBinary(TypeBinaryExpression)

Visits the children of a type binary expression.

Declaration
protected override Expression VisitTypeBinary(TypeBinaryExpression node)
Parameters
Type Name Description
System.Linq.Expressions.TypeBinaryExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

VisitUnary(UnaryExpression)

Visits the children of a unary expression.

Declaration
protected override Expression VisitUnary(UnaryExpression node)
Parameters
Type Name Description
System.Linq.Expressions.UnaryExpression node

The expression to visit.

Returns
Type Description
System.Linq.Expressions.Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.

In This Article
Back to top Generated by DocFX