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

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Example #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);
        }
Example #3
0
 protected void OnMonkeyTrick(object sender, MonkeyEventArgs e)
 {
     OnMonkeyExectureTrick(_monkey, e);
 }