Example #1
0
        public void Visit(Element element)
        {
            var employee = element as Employee;

            if (employee == null)
            {
                return;
            }

            // Provide 10% pay raise
            employee.Income *= 1.10;
            Console.WriteLine("{0} {1}'s new income: {2:C}", employee.GetType().Name, employee.Name, employee.Income);
        }
Example #2
0
        public void Visit(Element element)
        {
            var employee = element as Employee;

            if (employee == null)
            {
                return;
            }

            // Provide 3 extra vacation days
            employee.VacationDays += 3;
            Console.WriteLine("{0} {1}'s new vacation days: {2}", employee.GetType().Name, employee.Name, employee.VacationDays);
        }