public void CatchCold() { var args = new CatchColdEventArg(); args.Symptoms = new[] { "Sweating", "Dry Cough", "Nausea" }; GetsSick?.Invoke(this, args); }
private static void CallDoctor(object sender, CatchColdEventArg e) { var person = (Person)sender; Console.WriteLine("Calling Doctor..."); Console.WriteLine($"{person.Name} has catched a cold and He/She Displays the following Symptoms" + $"\n" + new string('=', 40)); foreach (var symptom in e.Symptoms) { Console.WriteLine("{0}", symptom); } }