Example #1
0
        public static void Main(string[] args)
        {
            ConcreteClassA a = new ConcreteClassA();
            ConcreteClassB b = new ConcreteClassB();

            IVisitor visitor = new VisitorImpl();

            a.Accept(visitor);
            b.Accept(visitor);

            Console.Read();
        }
Example #2
0
 public void Visit(ConcreteClassA instanceA)
 {
     Console.WriteLine(instanceA.GetType().Name);
 }