Esempio n. 1
0
        public void CompatibilityOfDelegateInstances()
        {
            ADelegateWithAnInt a = WriteToDebug;
            ADelegateWithAnInt b = WriteToDebug;
            ADelegateWithAnInt c = WriteToDebugWithMessage;

            var isInstanceAEqualToB = a == b;

            var isInstanceAEqualToC = a == c;
        }
Esempio n. 2
0
        public void CompatibilityOfDelegateTypes()
        {
            //ADelegateWithAnInt a = new ADelegateWithAnInt(WriteToDebug);
            ADelegateWithAnInt a = WriteToDebug;

            AnotherDelegateWithAnInt b;


            // This will not compile
            // b = a;

            // nor this
            // b = (AnotherDelegateWithAnInt) a;
        }