Пример #1
0
        private static void RunDelegatsReturnCovar()
        {
            //MyDelegateReturn<Ford> delegateDerivedBase = FooArgInBase;
            MyDelegateReturn <Ford> delegateDerivedDerived = FooArgInDerived;
            MyDelegateReturn <Car>  delegateBaseBase       = FooArgInBase;

            //MyDelegateReturn<Car> delegateBaseBase1 = delegateDerivedDerived;
            FooTakeDelegateReturn(delegateBaseBase);
            //FooTakeDelegate(delegateDerivedDerived);
            MyDelegateReturn <Car> delegateBaseDerived = FooArgInDerived;


            //MyDelegateReturnOut<Ford> delegateOutDerivedBase = FooArgInBase;
            MyDelegateReturnOut <Ford> delegateOutDerivedDerived = FooArgInDerived;
            MyDelegateReturnOut <Car>  delegateOutBaseBase       = FooArgInBase;
            MyDelegateReturnOut <Car>  delegateOutBaseBase1      = delegateOutDerivedDerived;

            FooTakeDelegateReturnOut(delegateOutBaseBase);
            FooTakeDelegateReturnOut(delegateOutDerivedDerived);
            MyDelegateReturnOut <Car> delegateOutBaseDerived = FooArgInDerived;
            Car a = delegateOutBaseDerived();
        }
Пример #2
0
 private static void FooTakeDelegateReturn(MyDelegateReturn <Car> foo)
 {
 }