Beispiel #1
0
 public static IObjectReference CreateMarshaler(object value)
 {
     if (value is null)
     {
         return(null);
     }
     return(ComWrappersSupport.CreateCCWForObject(value).As(PIID));
 }
Beispiel #2
0
        public IObjectReference Resolve(Guid riid)
        {
            if (!_ref.TryGetTarget(out object target))
            {
                return(null);
            }

            using (IObjectReference objReference = ComWrappersSupport.CreateCCWForObject(target))
            {
                return(objReference.As(riid));
            }
        }
Beispiel #3
0
            private static int Do_Abi_GetWeakReference(IntPtr thisPtr, out IntPtr weakReference)
            {
                weakReference = default;

                try
                {
                    weakReference = ComWrappersSupport.CreateCCWForObject(new global::WinRT.Interop.ManagedWeakReference(ComWrappersSupport.FindObject <object>(thisPtr))).As <ABI.WinRT.Interop.IWeakReference.Vftbl>().GetRef();
                }
                catch (Exception __exception__)
                {
                    return(__exception__.HResult);
                }
                return(0);
            }
Beispiel #4
0
 public static unsafe IObjectReference CreateMarshaler(global::System.EventHandler managedDelegate) =>
 managedDelegate is null ? null : ComWrappersSupport.CreateCCWForObject(managedDelegate).As <global::WinRT.Interop.IDelegateVftbl>(GuidGenerator.GetIID(typeof(CanExecuteChangedEventHandler)));
Beispiel #5
0
 public static IObjectReference CreateMarshaler(global::System.Collections.Generic.IReadOnlyList <T> obj) =>
 obj is null ? null : ComWrappersSupport.CreateCCWForObject(obj).As <Vftbl>(GuidGenerator.GetIID(typeof(IReadOnlyList <T>)));