static void Delegates() { SimplePerson person = new SimplePerson("Rowan", "Atkinson"); person.FormattedPrint(SimplePerson.FormatFirstName); person.FormattedPrint(SimplePerson.FormatFormalName); person.FormattedPrint(p => "Mr. " + p.LastName); }
public static string FormatFirstName(SimplePerson person) { return(person.FirstName); }
public static string FormatFormalName(SimplePerson person) { return(person.LastName + ", " + person.FirstName); }