예제 #1
0
 public void InInterfaceParameter()
 {
     using (var test = new ManagedImplementation())
     {
         Assert.True(nativeView.AreEqual(test));
     }
 }
예제 #2
0
 public void CloneInstance(out CallbackInterface @out)
 {
     if (ThrowExceptionInClone)
     {
         throw new InvalidOperationException();
     }
     @out = new ManagedImplementation();
 }
예제 #3
0
 public void InInterfaceParameter()
 {
     using (SetupTests(false, out var nativeView, out _))
     {
         using (var test = new ManagedImplementation())
         {
             Assert.True(nativeView.AreEqual(test));
         }
     }
 }
예제 #4
0
        private static IDisposable SetupTests(bool supportExceptions, out CallbackInterfaceNative nativeView, out ManagedImplementation target)
        {
            target     = supportExceptions ? new ExceptionEnabledManagedImplementation() : new ManagedImplementation();
            nativeView = new CallbackInterfaceNative(MarshallingHelpers.ToCallbackPtr <CallbackInterface>(target));

            return(new CompositeDisposable
            {
                target,
                nativeView
            });
        }
예제 #5
0
 public AutoShadowTests()
 {
     target     = new ManagedImplementation();
     nativeView = new CallbackInterfaceNative(CppObject.ToCallbackPtr <CallbackInterface>(target));
 }