Beispiel #1
0
    public static void Main()
    {
        TypePrinter printer = new TypePrinter();

        printer.Print <object>();

        ((ITypePrinter)printer).Print <object>();
    }
    public static void Main()
    {
        // This works
        TypePrinter printer = new TypePrinter();

        printer.Print <object>();

        // This doesn't work
        ((ITypePrinter)printer).Print <object>();
    }
        private void PrintSubTree(DataNode dataNode, ConsoleOptions options, string indent, bool last)
        {
            Console.WriteLine(indent + " + " + TypePrinter.Print(dataNode, options.ShowTypes));

            indent += last ? "  " : " |";
            int cnt = 0;

            dataNode.Expand();
            foreach (DataNode child in dataNode.Nodes)
            {
                cnt++;
                PrintSubTree(child, options, indent, cnt == dataNode.Nodes.Count);
            }
        }
Beispiel #4
0
        public override bool Process(DataNode dataNode, ConsoleOptions options)
        {
            Console.WriteLine(TypePrinter.Print(dataNode, options.ShowTypes));

            if (dataNode.IsContainerType)
            {
                foreach (var child in dataNode.Nodes)
                {
                    Console.WriteLine(" | " + TypePrinter.Print(child, options.ShowTypes));
                }
            }

            return(true);
        }