Exemplo n.º 1
0
    public static void Main(string[] args)
    {
        var br = new BaseResult();
        var dr = new DerivedResult();

        var bas = new Base();
        var derived = new Derived();

        bas.Method();
        bas.MethodWithParameter1(br);
        bas.MethodWithParameter1(dr);
        bas.MethodWithParameter2(dr);

        bas = derived;
        bas.Method();
        bas.MethodWithParameter1(br);
        bas.MethodWithParameter1(dr);
        bas.MethodWithParameter2(dr);

        derived.Method();
        derived.MethodWithParameter1(br);
        derived.MethodWithParameter1(dr);
        derived.MethodWithParameter2(br);
        derived.MethodWithParameter2(dr);
    }
Exemplo n.º 2
0
    public static void Main(string[] args)
    {
        var br = new BaseResult();
        var dr = new DerivedResult();

        var bas     = new Base();
        var derived = new Derived();

        bas.Method();
        bas.MethodWithParameter1(br);
        bas.MethodWithParameter1(dr);
        bas.MethodWithParameter2(dr);

        bas = derived;
        bas.Method();
        bas.MethodWithParameter1(br);
        bas.MethodWithParameter1(dr);
        bas.MethodWithParameter2(dr);

        derived.Method();
        derived.MethodWithParameter1(br);
        derived.MethodWithParameter1(dr);
        derived.MethodWithParameter2(br);
        derived.MethodWithParameter2(dr);
    }
Exemplo n.º 3
0
 public void MethodWithParameter1(DerivedResult r1)
 {
     Console.WriteLine("Derived MethodWithParameter1");
 }
Exemplo n.º 4
0
 public void MethodWithParameter2(DerivedResult r1)
 {
     Console.WriteLine("Base MethodWithParameter2");
 }
Exemplo n.º 5
0
 public void MethodWithParameter1(DerivedResult r1)
 {
     Console.WriteLine("Derived MethodWithParameter1");
 }
Exemplo n.º 6
0
 public void MethodWithParameter2(DerivedResult r1)
 {
     Console.WriteLine("Base MethodWithParameter2");
 }
 public void MethodWithParameter1(DerivedResult r1)
 {
 }
 public void MethodWithParameter1(DerivedResult r1)
 {
 }