예제 #1
0
		static void Main(string[] args) {

			var car = new Car();
			car.Accept(new CarElementPrintVisitor());
			car.Accept(new CarElementDoVisitor());

			Console.ReadKey();
		}
예제 #2
0
        private static void Main(string[] args)
        {
            var car = new Car();

            car.Accept(new CarElementPrintVisitor());
            car.Accept(new CarElementDoVisitor());

            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            var car = new Car();
            var v1  = new TestCarVisitor();
            var v2  = new RepairCarVisitor();

            car.Accept(v1);
            car.Accept(v2);

            Console.ReadLine();
        }
예제 #4
0
        static void Main(string[] args)
        {
            var car = new Car(new List <ICarElement>
            {
                new Body("Body"),
                new Engine("Engine"),
                new Wheel("Wheel")
            });

            car.Accept(new CarElementRepairVisitor());
            car.Accept(new CarElementPrintVisitor());
            Console.ReadKey();
        }