예제 #1
0
        static void Main(string[] args)
        {
            Hunter hunt  = new Hunter("Охотник 1");
            Hunter hunt2 = new Hunter("Охотник 2");
            Hunter hunt3 = new Hunter("Охотник 3");
            Hare   hare  = new Hare("Bro");

            hare.Moveding += hunt.d;
            hare.Moveding += hunt2.dlampda;
            hare.Moveding += hunt3.SendMessage;
            hare.Move();

            hare.Move();

            hare.Move();
        }
예제 #2
0
 public void SendMessage(Hare hare)
 {
     Console.WriteLine(Name + "--делегат через событие-" + hare.Name + ": " + hare.X.ToString() + "/" + hare.Y.ToString());
 }