public static int test_event(IInterfaceTest x, int value) { // reuse the event handler from eventtest.cs EventTest et = new EventTest(); x.TestEvent += et.GenericHandler; // raise the event (should trigger both python and managed handlers) x.OnTestEvent(value); x.TestEvent -= et.GenericHandler; return(et.value); }
public void InterceptorsTestWithDefaults() { IUnityContainer container = GetContainer("TestDefaults"); IInterfaceTest proxy = container.Resolve <IInterfaceTest>(); string input = String.Empty; string returnValue = proxy.TargetMethod(ref input); Assert.IsTrue(RemotingServices.IsTransparentProxy(proxy)); Assert.AreEqual <string>("PreAtargetPostA", input); IInterfaceTest proxy1 = container.Resolve <IInterfaceTest>("WithNameA"); string input1 = String.Empty; string returnValue1 = proxy1.TargetMethod(ref input1); Assert.IsFalse(RemotingServices.IsTransparentProxy(proxy1)); Assert.AreEqual <string>("target", input1); }
// test instances pass through managed code unchanged public static IInterfaceTest pass_through(IInterfaceTest s) { return s; }
public static string test_bar(IInterfaceTest x, string s, int i) { // calls into python if bar is overriden return x.bar(s, i); }
public static string test_foo(IInterfaceTest x) { // calls into python if foo is overriden return x.foo(); }
public static int test_event(IInterfaceTest x, int value) { // reuse the event handler from eventtest.cs EventTest et = new EventTest(); x.TestEvent += et.GenericHandler; // raise the event (should trigger both python and managed handlers) x.OnTestEvent(value); x.TestEvent -= et.GenericHandler; return et.value; }
public static string test_bar(IInterfaceTest x, string s, int i) { // calls into python if bar is overriden return(x.bar(s, i)); }
public static string test_foo(IInterfaceTest x) { // calls into python if foo is overriden return(x.foo()); }
// test instances pass through managed code unchanged public static IInterfaceTest pass_through(IInterfaceTest s) { return(s); }
public int GetIntGSDF(IInterfaceTest test) { return(0); }