| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911 |
- //
- // Expression.cs
- //
- // Author:
- // Jb Evain ([email protected])
- // Miguel de Icaza ([email protected])
- //
- // (C) 2008 Novell, Inc. (http://www.novell.com)
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to
- // permit persons to whom the Software is furnished to do so, subject to
- // the following conditions:
- //
- // The above copyright notice and this permission notice shall be
- // included in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Reflection;
- namespace System.Linq.Expressions {
- public abstract class Expression {
- ExpressionType node_type;
- Type type;
- public ExpressionType NodeType {
- get { return node_type; }
- }
- public Type Type {
- get { return type; }
- }
- // TODO: remove when all Expression subtypes
- // have their constructor implemented
- protected Expression ()
- {
- }
- protected Expression (ExpressionType node_type, Type type)
- {
- this.node_type = node_type;
- this.type = type;
- }
- public override string ToString ()
- {
- return ExpressionPrinter.ToString (this);
- }
- public static BinaryExpression Add (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.Add, left, right);
- }
- public static BinaryExpression Add (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.Add, left, right, false, method);
- }
- public static BinaryExpression AddChecked (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.AddChecked, left, right);
- }
- public static BinaryExpression AddChecked (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.AddChecked, left, right, false, method);
- }
- public static BinaryExpression And (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.And, left, right);
- }
- public static BinaryExpression And (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.And, left, right, false, method);
- }
- public static BinaryExpression AndAlso (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.AndAlso, left, right);
- }
- public static BinaryExpression AndAlso (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.AndAlso, left, right, false, method);
- }
- [MonoTODO]
- public static MethodCallExpression ArrayIndex (Expression left, params Expression [] indexes)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression ArrayIndex (Expression left, IEnumerable<Expression> indexes)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression ArrayIndex (Expression left, Expression index)
- {
- throw new NotImplementedException ();
- }
- public static UnaryExpression ArrayLength (Expression array)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (!array.Type.IsArray)
- throw new ArgumentException ("The type of the expression must me Array");
- if (array.Type.GetArrayRank () != 1)
- throw new ArgumentException ("The array must be a single dimensional array");
- return new UnaryExpression (ExpressionType.ArrayLength, array, typeof (int));
- }
- [MonoTODO]
- public static MemberAssignment Bind (MemberInfo member, Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberAssignment Bind (MethodInfo propertyAccessor, Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (Expression instance, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (MethodInfo method, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (Expression instance, MethodInfo method, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (Expression instance, MethodInfo method, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (Expression instance, string methodName, Type [] typeArguments, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MethodCallExpression Call (Type type, string methodName, Type [] typeArguments, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- public static BinaryExpression Coalesce (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.Coalesce, left, right);
- }
- public static BinaryExpression Coalesce (Expression left, Expression right, LambdaExpression conversion)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ConditionalExpression Condition (Expression test, Expression ifTrue, Expression ifFalse)
- {
- throw new NotImplementedException ();
- }
- public static ConstantExpression Constant (object value)
- {
- if (value == null)
- return new ConstantExpression (null, typeof (object));
-
- return Constant (value, value.GetType ());
- }
- public static ConstantExpression Constant (object value, Type type)
- {
- if (type == null)
- throw new ArgumentNullException ("type");
- //
- // value must be compatible with type, no conversions
- // are allowed
- //
- if (value == null){
- if (type.IsValueType && !IsNullable (type))
- throw new ArgumentException ();
- } else {
- if (!(type.IsValueType && IsNullable (type)) && value.GetType () != type)
- throw new ArgumentException ();
-
- }
- return new ConstantExpression (value, type);
- }
- [MonoTODO]
- public static UnaryExpression Convert (Expression expression, Type type)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression Convert (Expression expression, Type type, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression ConvertChecked (Expression expression, Type type)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression ConvertChecked (Expression expression, Type type, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- public static BinaryExpression Divide (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.Divide, left, right);
- }
- public static BinaryExpression Divide (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.Divide, left, right, false, method);
- }
- [MonoTODO]
- public static ElementInit ElementInit (MethodInfo addMethod, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ElementInit ElementInit (MethodInfo addMethod, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Equal (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.Equal, left, right);
- }
- public static BinaryExpression Equal (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- BinaryExpression ret = MakeBinary (ExpressionType.Equal, left, right, liftToNull, method);
- return ret;
- }
- public static BinaryExpression ExclusiveOr (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.ExclusiveOr, left, right);
- }
- public static BinaryExpression ExclusiveOr (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.ExclusiveOr, left, right, false, method);
- }
- [MonoTODO]
- public static MemberExpression Field (Expression expression, FieldInfo field)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression Field (Expression expression, string fieldName)
- {
- throw new NotImplementedException ();
- }
- public static Type GetActionType (params Type [] typeArgs)
- {
- if (typeArgs == null)
- throw new ArgumentNullException ("typeArgs");
- if (typeArgs.Length > 4)
- throw new ArgumentException ("No Action type of this arity");
- if (typeArgs.Length == 0)
- return typeof (Action);
- Type action = null;
- switch (typeArgs.Length) {
- case 1:
- action = typeof (Action<>);
- break;
- case 2:
- action = typeof (Action<,>);
- break;
- case 3:
- action = typeof (Action<,,>);
- break;
- case 4:
- action = typeof (Action<,,,>);
- break;
- }
- return action.MakeGenericType (typeArgs);
- }
- public static Type GetFuncType (params Type [] typeArgs)
- {
- if (typeArgs == null)
- throw new ArgumentNullException ("typeArgs");
- if (typeArgs.Length < 1 || typeArgs.Length > 5)
- throw new ArgumentException ("No Func type of this arity");
- Type func = null;
- switch (typeArgs.Length) {
- case 1:
- func = typeof (Func<>);
- break;
- case 2:
- func = typeof (Func<,>);
- break;
- case 3:
- func = typeof (Func<,,>);
- break;
- case 4:
- func = typeof (Func<,,,>);
- break;
- case 5:
- func = typeof (Func<,,,,>);
- break;
- }
- return func.MakeGenericType (typeArgs);
- }
- public static BinaryExpression GreaterThan (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.GreaterThan, left, right);
- }
- public static BinaryExpression GreaterThan (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- return MakeBinary (ExpressionType.GreaterThan, left, right, liftToNull, method);
- }
- public static BinaryExpression GreaterThanOrEqual (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.GreaterThanOrEqual, left, right);
- }
- public static BinaryExpression GreaterThanOrEqual (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- return MakeBinary (ExpressionType.GreaterThanOrEqual, left, right, liftToNull, method);
- }
- [MonoTODO]
- public static InvocationExpression Invoke (Expression expression, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static InvocationExpression Invoke (Expression expression, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static Expression<TDelegate> Lambda<TDelegate> (Expression body, params ParameterExpression [] parameters)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static Expression<TDelegate> Lambda<TDelegate> (Expression body, IEnumerable<ParameterExpression> parameters)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static LambdaExpression Lambda (Expression body, params ParameterExpression [] parameters)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static LambdaExpression Lambda (Type delegateType, Expression body, params ParameterExpression [] parameters)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static LambdaExpression Lambda (Type delegateType, Expression body, IEnumerable<ParameterExpression> parameters)
- {
- throw new NotImplementedException ();
- }
- public static BinaryExpression LeftShift (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.LeftShift, left, right);
- }
- public static BinaryExpression LeftShift (Expression left, Expression right, MethodInfo method)
- {
- return MakeBinary (ExpressionType.LeftShift, left, right, false, method);
- }
- public static BinaryExpression LessThan (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.LessThan, left, right);
- }
- public static BinaryExpression LessThan (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- return MakeBinary (ExpressionType.LessThan, left, right, liftToNull, method);
- }
- public static BinaryExpression LessThanOrEqual (Expression left, Expression right)
- {
- return MakeBinary (ExpressionType.LessThanOrEqual, left, right);
- }
- public static BinaryExpression LessThanOrEqual (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- return MakeBinary (ExpressionType.LessThanOrEqual, left, right, liftToNull, method);
- }
- public static MemberListBinding ListBind (MemberInfo member, params ElementInit [] initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberListBinding ListBind (MemberInfo member, IEnumerable<ElementInit> initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberListBinding ListBind (MethodInfo propertyAccessor, params ElementInit [] initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberListBinding ListBind (MethodInfo propertyAccessor, IEnumerable<ElementInit> initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, params ElementInit [] initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, IEnumerable<ElementInit> initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, params Expression [] initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, IEnumerable<Expression> initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, MethodInfo addMethod, params Expression [] initializers)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ListInitExpression ListInit (NewExpression newExpression, MethodInfo addMethod, IEnumerable<Expression> initializers)
- {
- throw new NotImplementedException ();
- }
- public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right)
- {
- return MakeBinary (binaryType, left, right, false, null);
- }
- public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- if (left == null)
- throw new ArgumentNullException ("left");
- if (right == null)
- throw new ArgumentNullException ("right");
- if (method == null)
- throw new ArgumentNullException ("method");
- if (binaryType < 0 || binaryType > ExpressionType.TypeIs)
- throw new ArgumentException ("Out of range", "binaryType");
- BinaryExpression ret = new BinaryExpression (left, right, liftToNull, method);
- ret.node_type = binaryType;
- return ret;
- }
- [MonoTODO]
- public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method, LambdaExpression conversion)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression MakeMemberAccess (Expression expression, MemberInfo member)
- {
- throw new NotImplementedException ();
- }
- public static UnaryExpression MakeUnary (ExpressionType unaryType, Expression operand, Type type)
- {
- return MakeUnary (unaryType, operand, type, null);
- }
- public static UnaryExpression MakeUnary (ExpressionType unaryType, Expression operand, Type type, MethodInfo method)
- {
- switch (unaryType) {
- case ExpressionType.ArrayLength:
- return ArrayLength (operand);
- case ExpressionType.Convert:
- return Convert (operand, type, method);
- case ExpressionType.ConvertChecked:
- return ConvertChecked (operand, type, method);
- case ExpressionType.Negate:
- return Negate (operand, method);
- case ExpressionType.NegateChecked:
- return NegateChecked (operand, method);
- case ExpressionType.Not:
- return Not (operand, method);
- case ExpressionType.Quote:
- return Quote (operand);
- case ExpressionType.TypeAs:
- return TypeAs (operand, type);
- case ExpressionType.UnaryPlus:
- return UnaryPlus (operand, method);
- }
- throw new ArgumentException ("MakeUnary expect an unary operator");
- }
- [MonoTODO]
- public static MemberMemberBinding MemberBind (MemberInfo member, params MemberBinding [] binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberMemberBinding MemberBind (MemberInfo member, IEnumerable<MemberBinding> binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberMemberBinding MemberBind (MethodInfo propertyAccessor, params MemberBinding [] binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberMemberBinding MemberBind (MethodInfo propertyAccessor, IEnumerable<MemberBinding> binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberInitExpression MemberInit (NewExpression newExpression, params MemberBinding [] binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberInitExpression MemberInit (NewExpression newExpression, IEnumerable<MemberBinding> binding)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Modulo (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Modulo (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Multiply (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Multiply (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression MultiplyChecked (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression MultiplyChecked (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression Negate (Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression Negate (Expression expression, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression NegateChecked (Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression NegateChecked (Expression expression, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (ConstructorInfo constructor)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (Type type)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (ConstructorInfo constructor, params Expression [] arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments, params MemberInfo [] members)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments, IEnumerable<MemberInfo> members)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewArrayExpression NewArrayBounds (Type type, params Expression [] bounds)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewArrayExpression NewArrayBounds (Type type, IEnumerable<Expression> bounds)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewArrayExpression NewArrayInit (Type type, params Expression [] bounds)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static NewArrayExpression NewArrayInit (Type type, IEnumerable<Expression> bounds)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression Not (Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression Not (Expression expression, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression NotEqual (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression NotEqual (Expression left, Expression right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Or (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Or (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression OrElse (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression OrElse (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static ParameterExpression Parameter (Type type, string name)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Power (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Power (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression Property (Expression expression, MethodInfo propertyAccessor)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression Property (Expression expression, PropertyInfo property)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression Property (Expression expression, string propertyName)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static MemberExpression PropertyOrField (Expression expression, string propertyOrFieldName)
- {
- throw new NotImplementedException ();
- }
- public static UnaryExpression Quote (Expression expression)
- {
- if (expression == null)
- throw new ArgumentNullException ("expression");
- return new UnaryExpression (ExpressionType.Quote, expression);
- }
- [MonoTODO]
- public static BinaryExpression RightShift (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression RightShift (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Subtract (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression Subtract (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression SubtractChecked (Expression left, Expression right)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static BinaryExpression SubtractChecked (Expression left, Expression right, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- public static UnaryExpression TypeAs (Expression expression, Type type)
- {
- if (expression == null)
- throw new ArgumentNullException ("expression");
- if (type == null)
- throw new ArgumentNullException ("type");
- return new UnaryExpression (ExpressionType.TypeAs, expression, type);
- }
- [MonoTODO]
- public static TypeBinaryExpression TypeIs (Expression expression, Type type)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression UnaryPlus (Expression expression)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnaryExpression UnaryPlus (Expression expression, MethodInfo method)
- {
- throw new NotImplementedException ();
- }
- static bool IsNullable (Type type)
- {
- return type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>);
- }
- }
- }
|