Ejemplo n.º 1
0
            public static String Print(IExpressionDescription ex)
            {
                if (ex == null)
                {
                    return("");
                }
                //return AsString((dynamic) ex);
                var typeInfo = ex.GetType().GetTypeInfo();

                if (typeInfo.IsAssignableFrom(typeof(VariableReferenceTree)))
                {
                    return(AsString(ex as VariableReferenceTree));
                }
                else if (typeInfo.IsAssignableFrom(typeof(LiquidNumeric)) ||
                         typeInfo.IsAssignableFrom(typeof(IntLiquidNumeric)))

                {
                    return(AsString(ex as LiquidNumeric));
                }
                else if (typeInfo.IsAssignableFrom(typeof(LiquidString)))
                {
                    return(AsString(ex as LiquidString));
                }

                else if (typeInfo.IsAssignableFrom(typeof(VariableReference)))
                {
                    return(AsString(ex as VariableReference));
                }
                else
                {
                    return(AsString(ex));
                }
            }
Ejemplo n.º 2
0
 private static String AsString(IExpressionDescription ex)
 {
     return("Unknown " + ex + "[" + ex.GetType().GetTypeInfo().ToString() + "]");
 }