Beispiel #1
0
        public static void Main(string []args)
        {
            FolderFile folder1 = new FolderFile("Documents");
            FolderFile folder2 = new FolderFile("TaxDocs");

            folder2.addFile(new TextFile("W2JPMorgan")).addFile(new TextFile("1099Form"));
            folder1.addFile(new TextFile("resume")).addFile(new TextFile("favorites")).addFile(folder2);

            FileVisitor visitor = new DirectoryPrinter();
            folder1.accept(visitor);
            Console.ReadLine();
        }
Beispiel #2
0
 public abstract void visit(FolderFile f);
Beispiel #3
0
 public override void visit(FolderFile f)
 {
     Console.WriteLine(this.getDashes() + "[DIRECTORY]" + f.name);
 }