Esempio n. 1
0
        /// <summary>
        /// Creates an XmlBinaryExpression from the specified binary expression
        /// </summary>
        public XmlBinaryExpression(BinaryExpression expr)
        {
            BinaryOperatorType opType = BinaryOperatorType.AndAlso;

            if (!Enum.TryParse <BinaryOperatorType>(expr.NodeType.ToString(), out opType))
            {
                throw new ArgumentOutOfRangeException(nameof(Expression.NodeType));
            }
            this.Operator = opType;

            this.Parts = new List <XmlExpression>()
            {
                XmlExpression.FromExpression(expr.Left),
                XmlExpression.FromExpression(expr.Right)
            };
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new xml expression list
 /// </summary>
 public XmlExpressionList(IEnumerable <Expression> expr)
 {
     this.Item = new List <XmlExpression>(expr.Select(o => XmlExpression.FromExpression(o)));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates the bound expression
 /// </summary>
 public XmlBoundExpression(UnaryExpression expr)
 {
     this.Object = XmlExpression.FromExpression(expr.Operand);
 }
Esempio n. 4
0
 /// <summary>
 /// Creates the bound expression
 /// </summary>
 public XmlBoundExpression(MethodCallExpression expr)
 {
     this.Object = XmlExpression.FromExpression(expr.Object);
 }
Esempio n. 5
0
 /// <summary>
 /// Creates the bound expression
 /// </summary>
 public XmlBoundExpression(MemberExpression expr)
 {
     this.Object = XmlExpression.FromExpression(expr.Expression);
 }
Esempio n. 6
0
 /// <summary>
 /// Creates type bound expression
 /// </summary>
 /// <param name="expr"></param>
 public XmlBoundExpression(TypeBinaryExpression expr)
 {
     this.Object = XmlExpression.FromExpression(expr.Expression);
 }
Esempio n. 7
0
 /// <summary>
 /// Creates the bound expression
 /// </summary>
 public XmlBoundExpression(Expression expr)
 {
     this.Object = XmlExpression.FromExpression(expr);
 }