本文整理汇总了C#中ExpressionType类的典型用法代码示例。如果您正苦于以下问题:C# ExpressionType类的具体用法?C# ExpressionType怎么用?C# ExpressionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionType类属于命名空间,在下文中一共展示了ExpressionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnaryExpression
internal UnaryExpression(ExpressionType nodeType, Expression expression, Type type, MethodInfo method)
{
_operand = expression;
_method = method;
_nodeType = nodeType;
_type = type;
}
示例2: Calculate
private Expression Calculate(Expression expression, ExpressionType binaryType, bool constant)
{
if (binaryType == ExpressionType.NotEqual)
constant = !constant;
return constant ? expression : Expression.Not(expression);
}
示例3: UnaryOperationOnMemberBinder
/// <summary>
/// Constructor of the OperationOnIndexBinder object, representing "a.b (op)= c" operation.
/// </summary>
/// <param name="operation">Binary operation to be performed.</param>
/// <param name="name">Name of the member for the operation.</param>
/// <param name="ignoreCase">Ignore case of the member.</param>
protected UnaryOperationOnMemberBinder(ExpressionType operation, string name, bool ignoreCase) {
ContractUtils.RequiresNotNull(name, "name");
ContractUtils.Requires(UnaryOperationBinder.OperationIsValid(operation), "operation");
_operation = operation;
_name = name;
_ignoreCase = ignoreCase;
}
示例4: MethodExpression
protected MethodExpression(ExpressionType type, Expression objectReference, MethodSymbol method, Collection<Expression> parameters) :
base(type, (method.AssociatedType.Type == SymbolType.GenericParameter ? objectReference.EvaluatedType : method.AssociatedType),
SymbolFilter.Public | SymbolFilter.InstanceMembers) {
_method = method;
_objectReference = objectReference;
_parameters = (parameters == null) ? new Collection<Expression>() : parameters;
}
示例5: ExtensionExpression
/// <summary>
/// Initializes a new instance of the <see cref="ExtensionExpression"/> class with a custom <see cref="ExpressionType"/> value.
/// </summary>
/// <param name="type">The type of the value represented by the <see cref="ExtensionExpression"/>.</param>
/// <param name="nodeType">The <see cref="ExpressionType"/> value to use as this expression's <see cref="Expression.NodeType"/> value.
/// LINQ providers should use values starting from 150001 and above.</param>
protected ExtensionExpression (Type type, ExpressionType nodeType)
{
ArgumentUtility.CheckNotNull ("type", type);
_type = type;
_nodeType = nodeType;
}
示例6:
/// <summary>
/// 获取常量转换处理函数
/// </summary>
/// <param name="type">数据类型</param>
/// <returns>失败返回null</returns>
public action<converter, Expression> this[ExpressionType type]
{
get
{
return converters[(int)type];
}
}
示例7: UnaryExpression
//public bool IsLiftedToNull {
// get { return is_lifted && this.Type.IsNullable (); }
//}
UnaryExpression (ExpressionType nodeType, Expression operand, Type type, MethodInfo method, bool isLifted)
: base(nodeType, type)
{
Operand = operand;
Method = method;
IsLifted = isLifted;
}
示例8: UnaryExpression
internal UnaryExpression(ExpressionType nodeType, Expression expression, Type type, MethodInfo method)
{
this._operand = expression;
this._method = method;
this._nodeType = nodeType;
this._type = type;
}
示例9: AddBinary
protected OperatorImplementation AddBinary(ExpressionType op, Type commonType,
BinaryOperatorMethod binaryMethod, UnaryOperatorMethod resultConverter) {
var key = new OperatorDispatchKey(op, commonType, commonType);
var impl = new OperatorImplementation(key, commonType, binaryMethod, null, null, resultConverter);
OperatorImplementations[key] = impl;
return impl;
}
示例10: GetSymbolName
private static String GetSymbolName(ExpressionType operation)
{
switch (operation)
{
case ExpressionType.Negate:
return "-";
case ExpressionType.UnaryPlus:
return "+";
case ExpressionType.NegateChecked:
return "-";
case ExpressionType.Not:
return "!";
case ExpressionType.Quote:
return "quote";
case ExpressionType.Decrement:
return "--";
case ExpressionType.Increment:
return "++";
case ExpressionType.PreIncrementAssign:
return "++=";
case ExpressionType.PreDecrementAssign:
return "--=";
case ExpressionType.PostIncrementAssign:
return "=++";
case ExpressionType.PostDecrementAssign:
return "=--";
case ExpressionType.OnesComplement:
return "~";
}
throw new NotSupportedException("YacqUnaryOperationBinder does not supports " + operation);
}
示例11: BinaryExpression
public BinaryExpression(Expression left, Expression right, ExpressionType nodeType,
bool liftToNull, MethodInfo method) : base(nodeType)
{
Left = left;
Right = right;
Method = method;
}
示例12: ConvertBinaryTypeToSql
public static string ConvertBinaryTypeToSql(ExpressionType type)
{
switch (type)
{
case ExpressionType.GreaterThan:
return " > ";
case ExpressionType.GreaterThanOrEqual:
return " >= ";
case ExpressionType.LessThan:
return " < ";
case ExpressionType.LessThanOrEqual:
return " <= ";
case ExpressionType.And:
case ExpressionType.AndAlso:
return " AND ";
case ExpressionType.Or:
case ExpressionType.OrElse:
return " OR ";
case ExpressionType.Equal:
return " = ";
case ExpressionType.NotEqual:
return " <> ";
}
throw new NotImplementedException("The expression type: " + type);
}
示例13: Expression
string _UniqueName; // unique name of expression; not always created
internal Expression(ReportDefn r, ReportLink p, XmlNode xNode, ExpressionType et) : base(r, p)
{
_Source=xNode.InnerText;
_Type = TypeCode.Empty;
_ExpectedType = et;
_Expr = null;
}
示例14: UnaryExpression
public UnaryExpression(ExpressionType nodeType, Expression operand, MethodInfo method, Type type) : base(nodeType)
{
Operand = operand;
Method = method;
this.type = type;
}
示例15: ExpressionTypeToOperator
public static Operators ExpressionTypeToOperator(ExpressionType et) {
switch (et) {
case ExpressionType.Add: return Operators.Add;
case ExpressionType.And: return Operators.BitwiseAnd;
case ExpressionType.Divide: return Operators.Divide;
case ExpressionType.ExclusiveOr: return Operators.ExclusiveOr;
case ExpressionType.Modulo: return Operators.Mod;
case ExpressionType.Multiply: return Operators.Multiply;
case ExpressionType.Or: return Operators.BitwiseOr;
case ExpressionType.Power: return Operators.Power;
case ExpressionType.RightShift: return Operators.RightShift;
case ExpressionType.LeftShift: return Operators.LeftShift;
case ExpressionType.Subtract: return Operators.Subtract;
case ExpressionType.AddAssign: return Operators.InPlaceAdd;
case ExpressionType.AndAssign: return Operators.InPlaceBitwiseAnd;
case ExpressionType.DivideAssign: return Operators.InPlaceDivide;
case ExpressionType.ExclusiveOrAssign: return Operators.InPlaceExclusiveOr;
case ExpressionType.ModuloAssign: return Operators.InPlaceMod;
case ExpressionType.MultiplyAssign: return Operators.InPlaceMultiply;
case ExpressionType.OrAssign: return Operators.InPlaceBitwiseOr;
case ExpressionType.PowerAssign: return Operators.InPlacePower;
case ExpressionType.RightShiftAssign: return Operators.InPlaceRightShift;
case ExpressionType.LeftShiftAssign: return Operators.InPlaceLeftShift;
case ExpressionType.SubtractAssign: return Operators.InPlaceSubtract;
case ExpressionType.Equal: return Operators.Equals;
case ExpressionType.GreaterThan: return Operators.GreaterThan;
case ExpressionType.GreaterThanOrEqual: return Operators.GreaterThanOrEqual;
case ExpressionType.LessThan: return Operators.LessThan;
case ExpressionType.LessThanOrEqual: return Operators.LessThanOrEqual;
case ExpressionType.NotEqual: return Operators.NotEquals;
}
return Operators.None;
}