Beispiel #1
0
        protected void OnMonkeyExectureTrick(object sender, MonkeyEventArgs e)
        {
            EventHandler <MonkeyEventArgs> handler = MonkeyExecuteTrick;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Beispiel #2
0
        public void WatchMonkey(object sender, MonkeyEventArgs e)
        {
            string action;

            if (e.Trick == MonkeyTrick.acrobatics)
            {
                action = "applause";
            }
            else
            {
                action = "whistle";
            }

            Console.WriteLine("{0} for {1} on {2}.", action, (sender as Monkey).Name, e.TrickName);
        }
Beispiel #3
0
 protected void OnMonkeyTrick(object sender, MonkeyEventArgs e)
 {
     OnMonkeyExectureTrick(_monkey, e);
 }