Example #1
0
        public void TestMethod1()
        {
            Caller c = new NewCaller();
            Shape  r = new Rectangle(10, 7);
            Shape  t = new Triangle(10, 5);

            c.CallArea(r);
            c.CallArea(t);
        }
Example #2
0
        public void TestMethod1()
        {
            Caller c = new NewCaller();
            Shape  r = new Rectangle(10, 7);
            Shape  t = new Triangle(10, 5);

            c.CallArea(r);
            c.CallArea(t);

            // without dispatching
            r.area((dynamic)c);
            t.area(c);
        }
Example #3
0
 public override int area(NewCaller c)
 {
     c.PrintMe();
     Trace.WriteLine("New Rectangle class area :");
     return(width * height);
 }
Example #4
0
 public virtual int area(NewCaller c)
 {
     Trace.WriteLine("New Parent class area :");
     return(0);
 }