Exemplo n.º 1
0
        public static string ToStatementString(this ValueOperator Operator)
        {
            switch (Operator)
            {
            case ValueOperator.Plus:
                return("+");

            case ValueOperator.Minus:
                return("-");

            case ValueOperator.Mult:
                return("*");

            case ValueOperator.Div:
                return("/");

            case ValueOperator.Mod:
                return("%");

            default:
                throw new ApplicationException("unsupported enum " + Operator.ToString());
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the UnknownOrUnsupportedValueOperatorException class
 /// </summary>
 /// <param name="valueOperator">The value operator that was unknown or unsupported</param>
 /// <param name="t">The type that the value operator cannot support</param>
 public UnknownOrUnsupportedValueOperatorException(ValueOperator valueOperator, Type t)
     : base(string.Format("The value operator '{0}' cannot be used on a {1} type", valueOperator.ToString(), t.Name))
 {
 }