Example #1
0
        static void Main(string[] args)
        {
            Employees employees = new Employees();

            employees.Attach(new Intern("Ali", 500, 7));
            employees.Attach(new Clark("Yiğit", 2000, 365));
            employees.Attach(new Director("Aysun", 4000, 180));
            employees.Attach(new President("Halit", 8000, 50));

            employees.Accept(new IncomeVisitor());
            employees.Accept(new VacationVisitor());
            employees.Accept(new BonusVisitor());
            employees.Accept(new PrintVisitor());

            Console.ReadLine();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Setup employee collection
            Employees e = new Employees();

            e.Attach(new Clerk());
            e.Attach(new Director());
            e.Attach(new President());

            // Employees are 'visited'
            e.Accept(new IncomeVisitor());
            e.Accept(new VacationVisitor());

            // Wait for user
            Console.ReadKey();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Setup employee collection
            Employees e = new Employees();
            e.Attach(new Clerk());
            e.Attach(new Director());
            e.Attach(new President());

            // Employees are 'visited'
            e.Accept(new IncomeVisitor());
            e.Accept(new VacationVisitor());

            // Wait for user
            Console.ReadKey();
        }