public static IObjectReference CreateMarshaler(object value) { if (value is null) { return(null); } return(ComWrappersSupport.CreateCCWForObject(value).As(PIID)); }
public IObjectReference Resolve(Guid riid) { if (!_ref.TryGetTarget(out object target)) { return(null); } using (IObjectReference objReference = ComWrappersSupport.CreateCCWForObject(target)) { return(objReference.As(riid)); } }
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); }
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)));
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>)));