예제 #1
0
파일: Delegate.cs 프로젝트: giagiigi/corefx
    public static void DynamicInvoke_CastingDefaultValues()
    {
        {
            // Passing Type.Missing without providing default.
            Delegate d = new DFoo1(Foo1);
            Assert.Throws <ArgumentException>(() => d.DynamicInvoke(7, Type.Missing));
        }

        {
            // Passing Type.Missing with default.
            Delegate d = new DFoo1WithDefault(Foo1);
            d.DynamicInvoke(7, Type.Missing);
        }
    }
예제 #2
0
        public static void DynamicInvoke_CastingDefaultValues()
        {
            {
                // Passing Type.Missing without providing default.
                Delegate d = new DFoo1(Foo1);
                Assert.Throws<ArgumentException>(() => d.DynamicInvoke(7, Type.Missing));
            }

            {
                // Passing Type.Missing with default.
                Delegate d = new DFoo1WithDefault(Foo1);
                d.DynamicInvoke(7, Type.Missing);
            }
        }