public IndexerExpression(Expression targetObject, params Expression[] indices)
 {
     if (targetObject==null)
         throw new ArgumentNullException("targetObject");
     this.targetObject = targetObject;
     this.indices.AddRange(indices);
 }
		/// <summary>
		/// Adds the elements of an array to the end of this ExpressionCollection.
		/// </summary>
		/// <param name="items">
		/// The array whose elements are to be added to the end of this ExpressionCollection.
		/// </param>
		public virtual void AddRange(Expression[] items)
		{
			foreach (Expression item in items)
			{
				this.List.Add(item);
			}
		}
        public ConditionStatement(Expression condition, params Statement[] trueStatements)
        {
            if (condition==null)
                throw new ArgumentNullException("condition");

            this.condition = condition;
            this.trueStatements.AddRange(trueStatements);
        }
示例#4
0
 /// <summary>
 /// Creates an assign statement: <c>left = right</c>
 /// </summary>
 /// <param name="left">
 /// Left <see cref="Expression"/> instance</param>
 /// <param name="right">
 /// Right <see cref="Expression"/> instance
 /// </param>
 /// <returns>
 /// A <see cref="AssignStatement"/> instance.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="left"/> or <paramref name="right"/>
 /// is a null reference (Nothing in Visual Basic)
 /// </exception>
 public static AssignStatement Assign(Expression left, Expression right)
 {
     if (left==null)
         throw new ArgumentNullException("left");
     if (right==null)
         throw new ArgumentNullException("right");
     return new AssignStatement(left,right);
 }
        public IterationStatement(Statement initStatement, Expression testExpression, Statement incrementStatement)
        {
            if (testExpression==null)
                throw new ArgumentNullException("testExpression");

            this.initStatement = initStatement;
            this.testExpression = testExpression;
            this.incrementStatement = incrementStatement;
        }
示例#6
0
 internal AttributeArgument(string name, Expression value)
 {
     if (name==null)
         throw new ArgumentNullException("name");
     if (value==null)
         throw new ArgumentNullException("value");
     this.name=name;
     this.value=value;
 }
 public AssignStatement(Expression left, Expression right)
 {
     if (left==null)
         throw new ArgumentNullException("left");
     if (right==null)
         throw new ArgumentNullException("righ");
     this.left = left;
     this.right = right;
 }
示例#8
0
 public override Expression ToCodeDom(Refly.CodeDom.Expressions.Expression factory)
 {
     return(factory.Method("MouseMove").Invoke(
                Expr.New(typeof(Point),
                         Expr.Prim(this.Target.X),
                         Expr.Prim(this.Target.Y)
                         )
                ));
 }
        public CastExpression(ITypeDeclaration targetType, Expression expression)
        {
            if (targetType==null)
                throw new ArgumentNullException("targetType");
            if (expression == null)
                throw new ArgumentNullException("expression");

            this.targetType = targetType;
            this.expression = expression;
        }
        public EventReferenceExpression(Expression target,EventDeclaration _event)
        {
            if (target==null)
                throw new ArgumentNullException("target");
            if (_event==null)
                throw new ArgumentNullException("_event");

            this.target = target;
            this.declaringEvent = _event;
        }
示例#11
0
        public FieldReferenceExpression(Expression target,FieldDeclaration field)
        {
            if (target==null)
                throw new ArgumentNullException("target");
            if (field==null)
                throw new ArgumentNullException("field");

            this.target = target;
            this.declaringField = field;
        }
示例#12
0
        public MethodReferenceExpression(Expression target,MethodDeclaration method)
        {
            if (target==null)
                throw new ArgumentNullException("target");
            if (method==null)
                throw new ArgumentNullException("method");

            this.target = target;
            this.declaringMethod = method;
        }
        public PropertyReferenceExpression(Expression target,PropertyDeclaration property)
        {
            if (target==null)
                throw new ArgumentNullException("target");
            if (property==null)
                throw new ArgumentNullException("property");

            this.target = target;
            this.property = property;
        }
        public NativeMethodReferenceExpression(Expression target,string name)
        {
            if (target==null)
                throw new ArgumentNullException("target");
            if (name==null)
                throw new ArgumentNullException("name");

            this.target = target;
            this.name = name;
        }
 public AttachRemoveEventStatement(EventReferenceExpression eventRef, Expression listener,bool attach)
 {
     if (eventRef==null)
         throw new ArgumentNullException("eventRef");
     if (listener==null)
         throw new ArgumentNullException("listener");
     this.eventRef = eventRef;
     this.listener = listener;
     this.attach=attach;
 }
        public ArrayCreationWithSizeExpression(
            ITypeDeclaration type,
            Expression sizeExpression)
        {
            if (type == null)
                throw new ArgumentNullException("type");
            if (sizeExpression == null)
                throw new ArgumentNullException("sizeExpression");

            this.type = type;
            this.sizeExpression = sizeExpression;
        }
 public BinaryOpOperatorExpression(
     Expression left,
     Expression right,
     CodeBinaryOperatorType op
     )
 {
     if (left==null)
         throw new ArgumentNullException("left");
     if (right==null)
         throw new ArgumentNullException("right");
     this.left = left;
     this.right = right;
     this.op = op;
 }
        public ForEachStatement(
            ITypeDeclaration localType,
            string localName,
            Expression collection,
            bool enumeratorDisposable
            )
        {
            if (localType==null)
                throw new ArgumentNullException("localType");
            if (localName==null)
                throw new ArgumentNullException("localName");
            if (collection ==null)
                throw new ArgumentNullException("collection");

            this.localType = localType;
            this.localName = localName;
            this.collection = collection;
            this.enumeratorDisposable = enumeratorDisposable;
        }
示例#19
0
 public static ForEachStatement ForEach( 
     ITypeDeclaration localType,
     string localName,
     Expression collection,
     bool enumeratorDisposable
     )
 {
     return new ForEachStatement(localType,localName,collection
         ,enumeratorDisposable
         );
 }
示例#20
0
 public static AttachRemoveEventStatement Attach(
     EventReferenceExpression eventRef,
     Expression listener)
 {
     return new AttachRemoveEventStatement(eventRef,listener,true);
 }
示例#21
0
 public static IterationStatement While(
     Expression testExpression
     )
 {
     return new IterationStatement(
         new SnippetStatement(""),
         testExpression,
         new SnippetStatement("")
         );
 }
示例#22
0
 public static ConditionStatement If(Expression condition, params Statement[] trueStatements)
 {
     if (condition==null)
         throw new ArgumentNullException("condition");
     return new ConditionStatement(condition,trueStatements);
 }
示例#23
0
 public static VariableDeclarationStatement Var(Type type, string name,Expression initExpression)
 {
     return Var(new TypeTypeDeclaration(type),name,initExpression);
 }
示例#24
0
 public static VariableDeclarationStatement Var(ITypeDeclaration type, string name,Expression initExpression)
 {
     VariableDeclarationStatement var =  Var(type,name);
     var.InitExpression = initExpression;
     return var;
 }
示例#25
0
 public static ConditionStatement ThrowIfNull(Expression condition, string message)
 {
     if (condition==null)
         throw new ArgumentNullException("condition");
     if (message==null)
         throw new ArgumentNullException("message");
     return ThrowIfNull(
         condition,
         Expr.New(typeof(NullReferenceException),Expr.Prim(message))
         );
 }
示例#26
0
 public static ExpressionStatement ToStm(Expression expr)
 {
     if (expr==null)
         throw new ArgumentNullException("expr");
     return new ExpressionStatement(expr);
 }
示例#27
0
 public static ConditionStatement ThrowIfNull(Expression condition, Expression toThrow)
 {
     if (condition==null)
         throw new ArgumentNullException("condition");
     if (toThrow==null)
         throw new ArgumentNullException("toThrow");
     return IfNull(condition,
         Stm.Throw(toThrow)
         );
 }
示例#28
0
 public static ThrowExceptionStatement Throw(Expression toThrow)
 {
     if (toThrow==null)
         throw new ArgumentNullException("toThrow");
     return new ThrowExceptionStatement(toThrow);
 }
示例#29
0
 public static MethodReturnStatement Return(Expression expr)
 {
     if (expr==null)
         throw new ArgumentNullException("expr");
     return new MethodReturnStatement(expr);
 }
示例#30
0
 public static ConditionStatement IfNull(Expression left,params Statement[] trueStatements)
 {
     if (left==null)
         throw new ArgumentNullException("left");
     return IfIdentity(
         left,Expr.Null,
         trueStatements
         );
 }
示例#31
0
 public static ConditionStatement IfNotIdentity(Expression left, Expression right, params Statement[] trueStatements)
 {
     if (left==null)
         throw new ArgumentNullException("left");
     if (right==null)
         throw new ArgumentNullException("right");
     return If(
         left.NotIdentity(right),
         trueStatements
         );
 }