예제 #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();
        }
예제 #2
0
 public void Export(EgyptEmployee employee)
 {
     Console.WriteLine($"Egypt salary of {employee.Name} is {employee.Salary}");
 }