Exemplo n.º 1
0
 public static IObjectReference CreateMarshaler(object value)
 {
     if (value is null)
     {
         return(null);
     }
     return(ComWrappersSupport.CreateCCWForObject(value).As(PIID));
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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);
            }
Exemplo n.º 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)));
Exemplo n.º 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>)));