Example #1
0
        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);
        }
Example #3
0
 // test instances pass through managed code unchanged
 public static IInterfaceTest pass_through(IInterfaceTest s)
 {
     return s;
 }
Example #4
0
 public static string test_bar(IInterfaceTest x, string s, int i)
 {
     // calls into python if bar is overriden
     return x.bar(s, i);
 }
Example #5
0
 public static string test_foo(IInterfaceTest x)
 {
     // calls into python if foo is overriden
     return x.foo();
 }
Example #6
0
        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;
        }
Example #7
0
 public static string test_bar(IInterfaceTest x, string s, int i)
 {
     // calls into python if bar is overriden
     return(x.bar(s, i));
 }
Example #8
0
 public static string test_foo(IInterfaceTest x)
 {
     // calls into python if foo is overriden
     return(x.foo());
 }
Example #9
0
 // test instances pass through managed code unchanged
 public static IInterfaceTest pass_through(IInterfaceTest s)
 {
     return(s);
 }
Example #10
0
 public int GetIntGSDF(IInterfaceTest test)
 {
     return(0);
 }