Exemplo n.º 1
0
        private static void Composite()
        {
            var drive = new Drive("Drive");
            var a     = new Directory("A");
            var b     = new Directory("B");
            var c     = new Directory("C");
            var d     = new Directory("D");

            a.Add(new File("A1"));
            a.Add(new File("A2"));
            b.Add(new File("B1"));
            c.Add(b);
            d.Add(c);
            d.Add(a);
            drive.Add(d);
            drive.Display();
        }