public unsafe IObjectReference CreateInstanceWithAllParameters(global::System.Collections.Specialized.NotifyCollectionChangedAction action, global::System.Collections.IList newItems, global::System.Collections.IList oldItems, int newIndex, int oldIndex, object baseInterface, out IObjectReference innerInterface) { IObjectReference __newItems = default; IObjectReference __oldItems = default; IObjectReference __baseInterface = default; IntPtr __innerInterface = default; IntPtr __retval = default; try { __newItems = MarshalInterface <global::System.Collections.IList> .CreateMarshaler(newItems); __oldItems = MarshalInterface <global::System.Collections.IList> .CreateMarshaler(oldItems); __baseInterface = MarshalInspectable <object> .CreateMarshaler(baseInterface); global::WinRT.ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateInstanceWithAllParameters_0(ThisPtr, action, MarshalInterface <global::System.Collections.IList> .GetAbi(__newItems), MarshalInterface <global::System.Collections.IList> .GetAbi(__oldItems), newIndex, oldIndex, MarshalInspectable <object> .GetAbi(__baseInterface), out __innerInterface, out __retval)); innerInterface = ObjectReference <IUnknownVftbl> .FromAbi(__innerInterface); return(ObjectReference <IUnknownVftbl> .FromAbi(__retval)); } finally { MarshalInterface <global::System.Collections.IList> .DisposeMarshaler(__newItems); MarshalInterface <global::System.Collections.IList> .DisposeMarshaler(__oldItems); MarshalInspectable <object> .DisposeMarshaler(__baseInterface); MarshalInspectable <object> .DisposeAbi(__innerInterface); MarshalInspectable <object> .DisposeAbi(__retval); } }
public unsafe IObjectReference CreateInstance(string name, object baseInterface, out IObjectReference innerInterface) { MarshalString __name = default; IObjectReference __baseInterface = default; IntPtr __innerInterface = default; IntPtr __retval = default; try { __name = MarshalString.CreateMarshaler(name); __baseInterface = MarshalInspectable <object> .CreateMarshaler(baseInterface); global::WinRT.ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateInstance_0(ThisPtr, MarshalString.GetAbi(__name), MarshalInspectable <object> .GetAbi(__baseInterface), &__innerInterface, &__retval)); innerInterface = ObjectReference <IUnknownVftbl> .FromAbi(__innerInterface); return(ObjectReference <IUnknownVftbl> .Attach(ref __retval)); } finally { MarshalString.DisposeMarshaler(__name); MarshalInspectable <object> .DisposeMarshaler(__baseInterface); MarshalInspectable <object> .DisposeAbi(__innerInterface); MarshalInspectable <object> .DisposeAbi(__retval); } }
public unsafe ObjectReference <I> _ActivateInstance <I>() { Marshal.ThrowExceptionForHR(_IActivationFactory.Vftbl.ActivateInstance(_IActivationFactory.ThisPtr, out IntPtr instancePtr)); try { return(ComWrappersSupport.GetObjectReferenceForInterface(instancePtr).As <I>()); } finally { MarshalInspectable.DisposeAbi(instancePtr); } }
public IObjectReference Resolve(Guid riid) { ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.Resolve(ThisPtr, ref riid, out IntPtr ptr)); try { return(ComWrappersSupport.GetObjectReferenceForInterface(ptr)); } finally { MarshalInspectable.DisposeAbi(ptr); } }
public global::WinRT.Interop.IWeakReference GetWeakReference() { IntPtr objRef = IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.GetWeakReference(ThisPtr, out objRef)); return(MarshalInterface <WinRT.Interop.IWeakReference> .FromAbi(objRef)); } finally { MarshalInspectable.DisposeAbi(objRef); } }
public Language(string languageTag) : this(((Func <global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage>)(() => { IntPtr ptr = (_ILanguageFactory.Instance.CreateLanguage(languageTag)); try { return(new global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage(ComWrappersSupport.GetObjectReferenceForInterface(ptr))); } finally { MarshalInspectable.DisposeAbi(ptr); } }))()) { ComWrappersSupport.RegisterObjectForInterface(this, ThisPtr); }