Пример #1
0
        /**
         * @param ve must be a <c>NumberEval</c>, <c>StringEval</c>, <c>BoolEval</c>, or <c>BlankEval</c>
         * @return the Converted string value. never <c>null</c>
         */
        public static String CoerceValueToString(ValueEval ve)
        {
            if (ve is StringValueEval)
            {
                StringValueEval sve = (StringValueEval)ve;
                return(sve.StringValue);
            }

            if (ve is BlankEval)
            {
                return("");
            }
            throw new ArgumentException("Unexpected eval class (" + ve.GetType().Name + ")");
        }
Пример #2
0
 private Object GetText(ValueEval ve)
 {
     if (ve is StringValueEval)
     {
         StringValueEval sve = (StringValueEval)ve;
         return(sve.StringValue);
     }
     if (ve == BlankEval.instance)
     {
         return("");
     }
     throw new InvalidOperationException("Unexpected value type ("
                                         + ve.GetType().Name + ")");
 }