예제 #1
0
        // Not very performant or safe
        private static void DynamicVisitorExample()
        {
            DynamicExpression e = new DynamicAdditionExpression(new DynamicDoubleExpression(1.0), new DynamicAdditionExpression(new DynamicDoubleExpression(2.0), new DynamicDoubleExpression(3.0)));
            var ep = new DynamicExpressionPrinter();
            var sb = new StringBuilder();

            ep.Print((dynamic)e, sb);
            Console.WriteLine(sb);
        }
예제 #2
0
        private static void Test4()
        {
            NewExpression additionalExpression = new NewAdditionExpression(new NewDoubleExpression(1),
                                                                           new NewAdditionExpression(new NewDoubleExpression(2),
                                                                                                     new NewDoubleExpression(3)));
            var sb = new StringBuilder();

            DynamicExpressionPrinter.Print((dynamic)additionalExpression, sb);
            Console.WriteLine(sb);
        }