static void Main(String[] args)
        {
            Computer cmp = new Computer();
            cmp.accept(new ComputerPartDisplayVisitor());

            Console.WriteLine("Press enter to close...");
            Console.ReadLine();
        }
 public void visit(Computer computer)
 {
     Console.WriteLine("Displaying Computer...");
 }
Ejemplo n.º 3
0
 public void Visit(Computer computer)
 {
     Console.WriteLine(computer.ToString());
 }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            IComputerPart computerPart = new Computer();

            computerPart.Accept(new ComputerPartDisplayVisitor());
        }