Exemple #1
0
        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");
            }
        }
Exemple #2
0
 public static CSLine Assign(CSBaseExpression name, CSAssignmentOperator op, CSBaseExpression value)
 {
     return(new CSLine(new CSAssignment(name, op, value)));
 }
Exemple #3
0
 public CSAssignment(CSBaseExpression lhs, CSAssignmentOperator op, CSBaseExpression rhs)
 {
     Target    = Exceptions.ThrowOnNull(lhs, "lhs");
     Value     = Exceptions.ThrowOnNull(rhs, "rhs");
     Operation = op;
 }
Exemple #4
0
 public CSAssignment(string lhs, CSAssignmentOperator op, CSBaseExpression rhs)
     : this(new CSIdentifier(Exceptions.ThrowOnNull(lhs, "lhs")), op, rhs)
 {
 }