static string ToAssignmentOpString(CSAssignmentOperator op) { switch (op) { case CSAssignmentOperator.Assign: return("="); case CSAssignmentOperator.AddAssign: return("+="); case CSAssignmentOperator.SubAssign: return("-="); case CSAssignmentOperator.MulAssign: return("*="); case CSAssignmentOperator.DivAssign: return("/="); case CSAssignmentOperator.ModAssign: return("%="); case CSAssignmentOperator.AndAssign: return("&="); case CSAssignmentOperator.OrAssign: return("|="); case CSAssignmentOperator.XorAssign: return("^="); default: throw new ArgumentOutOfRangeException("op"); } }
public static CSLine Assign(CSBaseExpression name, CSAssignmentOperator op, CSBaseExpression value) { return(new CSLine(new CSAssignment(name, op, value))); }
public CSAssignment(CSBaseExpression lhs, CSAssignmentOperator op, CSBaseExpression rhs) { Target = Exceptions.ThrowOnNull(lhs, "lhs"); Value = Exceptions.ThrowOnNull(rhs, "rhs"); Operation = op; }
public CSAssignment(string lhs, CSAssignmentOperator op, CSBaseExpression rhs) : this(new CSIdentifier(Exceptions.ThrowOnNull(lhs, "lhs")), op, rhs) { }