Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     ScaryScary fingersTheClown = new ScaryScary("big shoes", 14);
     FunnyFunny someFunnyClown = fingersTheClown;
     if (someFunnyClown is IScaryClown)
     {
         IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary;
         someOtherScaryClown.Honk();
     }
 }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ScaryScary fingersTheClown = new ScaryScary("big shoes", 14);
            FunnyFunny someFunnyClown  = fingersTheClown;

            if (someFunnyClown is IScaryClown)
            {
                IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary;
                someOtherScaryClown.Honk();
            }
        }