Пример #1
0
        void GreetAndFarewell(Salutation person)
        {
            Console.WriteLine(person.Greet());
            Console.WriteLine(person.Farewell());

            Console.WriteLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // Use the Salutation class for a Walmart Greeter.
            Salutation oldGuy = new Salutation("Welcome to Walmart!", "Thanks for shopping at Walmart!");

            // Get the guy to talk...
            Console.WriteLine();
        }
Пример #3
0
 private void Speak(Salutation speaker)
 {
     Console.WriteLine(speaker.Greet());
     Console.WriteLine(speaker.SayFareWell());
 }