示例#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();
        }
示例#2
0
 public void Visit(ConcreteClassB instanceB)
 {
     Console.WriteLine(instanceB.GetType().Name);
 }