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