//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>"); }
public abstract String Format(SQLCode sqlCode);