static void Main() { ConcreteClass instance = new ConcreteClass(); instance.Method(); // Delay. Console.ReadKey(); }
static void Main() { ConcreteClass instance = new ConcreteClass(); instance.Method(); IInterface1 instance1 = instance as IInterface1; instance1.Method(); IInterface2 instance2 = instance as IInterface2; instance2.Method(); // Delay. Console.ReadKey(); }
static void Main() { ConcreteClass instance = new ConcreteClass(); //instance.Method(); IInterface1 instance1 = instance as IInterface1; instance1.Method(); IInterface2 instance2 = instance as IInterface2; instance2.Method(); // Delay. Console.ReadKey(); }