Example #1
0
        public void ExplicitInterfaceProperty()
        {
            var obj = new ExplicitInterface();

            obj.Property = "foo";
            IExplicitInterface intf = obj;

            AssertEquals(intf.Property, "foo");
        }
Example #2
0
        public static void ExplicitInterfaceMethod(Int32 numberIterations)
        {
            MethodTest         m = new MethodTestDerived();
            IExplicitInterface t = (IExplicitInterface)m;

            for (int i = 0; i < numberIterations; ++i)
            {
                t.ExplicitInterfaceMethod();
            }
        }
Example #3
0
        public void ExplicitInterfacePropertyReflection()
        {
            var obj = new ExplicitInterface();

            obj.Property = "foo";
            IExplicitInterface intf = obj;
            Expression <Func <IExplicitInterface, object> > expression = x => x.Property;
            var compiled = expression.Compile();
            var value    = compiled(intf);

            AssertEquals(value, "foo");
        }