예제 #1
0
        internal static void Main()
        {
            // Setup employee collection
            var employees = new Employees();
            employees.Attach(new Clerk());
            employees.Attach(new Director());
            employees.Attach(new President());

            // Employees are 'visited'
            employees.Accept(new IncomeVisitor());
            employees.Accept(new VacationVisitor());
        }
예제 #2
0
        /// <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();
        }
예제 #3
0
        internal static void Main()
        {
            // Greshno, tai kato ne e rabota na Main metoda da vdiga zaplatatata na employee
            // Zatova se pravi IncomeVisitor, koito ima pravomostiata da ia vdiga
            var employee = new Clerk();
            employee.Income += 1000;

            // Setup employee collection
            var employees = new Employees();
            employees.Attach(new Clerk());
            employees.Attach(new Director());
            employees.Attach(new President());

            // Employees are 'visited'
            employees.Accept(new IncomeVisitor());
            employees.Accept(new VacationVisitor());
        }
예제 #4
0
        private void button6_Click(object sender, EventArgs e)
        {
            Employees empleados = new Employees();
            empleados.Attach(new Director());

            empleados.Accept(new VisitorIngreso());
        }