Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello Visitor design pattern!");

            var swissEmployee = new SwissEmployee("Nghia", 1000);
            var export        = new ExportVisitor();

            export.Export(swissEmployee);

            var egyptEmployee = new EgyptEmployee("Sopanos", 1000);

            egyptEmployee.Accept(export);

            Console.ReadKey();
        }
Esempio n. 2
0
 public void Export(SwissEmployee employee)
 {
     Console.WriteLine($"Swiss salary of {employee.Name} is {employee.Salary}");
 }