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); }
/// <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; }
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; }
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; }
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; }
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; }
public static ForEachStatement ForEach( ITypeDeclaration localType, string localName, Expression collection, bool enumeratorDisposable ) { return new ForEachStatement(localType,localName,collection ,enumeratorDisposable ); }
public static AttachRemoveEventStatement Attach( EventReferenceExpression eventRef, Expression listener) { return new AttachRemoveEventStatement(eventRef,listener,true); }
public static IterationStatement While( Expression testExpression ) { return new IterationStatement( new SnippetStatement(""), testExpression, new SnippetStatement("") ); }
public static ConditionStatement If(Expression condition, params Statement[] trueStatements) { if (condition==null) throw new ArgumentNullException("condition"); return new ConditionStatement(condition,trueStatements); }
public static VariableDeclarationStatement Var(Type type, string name,Expression initExpression) { return Var(new TypeTypeDeclaration(type),name,initExpression); }
public static VariableDeclarationStatement Var(ITypeDeclaration type, string name,Expression initExpression) { VariableDeclarationStatement var = Var(type,name); var.InitExpression = initExpression; return var; }
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)) ); }
public static ExpressionStatement ToStm(Expression expr) { if (expr==null) throw new ArgumentNullException("expr"); return new ExpressionStatement(expr); }
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) ); }
public static ThrowExceptionStatement Throw(Expression toThrow) { if (toThrow==null) throw new ArgumentNullException("toThrow"); return new ThrowExceptionStatement(toThrow); }
public static MethodReturnStatement Return(Expression expr) { if (expr==null) throw new ArgumentNullException("expr"); return new MethodReturnStatement(expr); }
public static ConditionStatement IfNull(Expression left,params Statement[] trueStatements) { if (left==null) throw new ArgumentNullException("left"); return IfIdentity( left,Expr.Null, trueStatements ); }
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 ); }