public void ExplicitInterfaceProperty() { var obj = new ExplicitInterface(); obj.Property = "foo"; IExplicitInterface intf = obj; AssertEquals(intf.Property, "foo"); }
public static void ExplicitInterfaceMethod(Int32 numberIterations) { MethodTest m = new MethodTestDerived(); IExplicitInterface t = (IExplicitInterface)m; for (int i = 0; i < numberIterations; ++i) { t.ExplicitInterfaceMethod(); } }
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"); }