示例#1
0
        //Tries to cast a value of any type to type T
        private bool tryParseValue(Object input, out T result)
        {
            if (input.GetType() == typeof(T)) //The input type matches, make a regular cast
            {
                result = (T)input;
                return(true);
            }

            if (typeof(T).Equals(typeof(SQLCode)))
            {
                Object sqlCode = new SQLCode(input.ToString());
                result = (T)sqlCode;
                return(true);
            }

            //Try to cast from string to T
            if (input is String)
            {
                Object res;
                bool   succ = tryParseValue((String)input, out res);
                result = (T)res;
                return(succ);
            }

            result = default(T);
            return(false);
        }
 public override string Format(SQLCode sqlCode)
 {
     return("<pre>" + sqlCode + "</pre>");
 }
示例#3
0
 public abstract String Format(SQLCode sqlCode);