コード例 #1
0
ファイル: Program.cs プロジェクト: JonasPhilbert/dmu4-csharp
        static void Delegates()
        {
            SimplePerson person = new SimplePerson("Rowan", "Atkinson");

            person.FormattedPrint(SimplePerson.FormatFirstName);
            person.FormattedPrint(SimplePerson.FormatFormalName);
            person.FormattedPrint(p => "Mr. " + p.LastName);
        }
コード例 #2
0
 public static string FormatFirstName(SimplePerson person)
 {
     return(person.FirstName);
 }
コード例 #3
0
 public static string FormatFormalName(SimplePerson person)
 {
     return(person.LastName + ", " + person.FirstName);
 }