class Employee
{
public int Age;
public string Name;
public Employee(string name, int age)
{
Age = age;
Name = name;
}
}
private delegate void testEmployee(Employee arg);
private static void TestEmployee()
{
testEmployee test;
Employee emp = new Employee("cloudio", 28);
test = delegate(Employee arg)
{
arg.Name = "test";
};
test(emp);
MessageBox.Show(emp.Name);
test = delegate(Employee arg)
{
Employee newEmp = new Employee("new emp", 88);
arg = newEmp;
};
test(emp);
MessageBox.Show(emp.Name);
}