Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("***** Simple Interface Hierarchy *****");

            // Call from an object level.
            BitmapImage bitmap = new BitmapImage();

            bitmap.Draw();
            bitmap.DrawInBoudingBox(10, 10, 100, 150);
            bitmap.DrawUpsideDown();

            // Get IAdvancedDraw explicitly.
            if (bitmap is IAdvancedDraw advancedDraw)
            {
                advancedDraw.DrawUpsideDown();
            }
            Console.ReadLine();
        }