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);
            }
        }
Пример #2
0
Файл: Uri.cs Проект: wjk/CsWinRT
        public unsafe IObjectReference CreateUri(string uri)
        {
            MarshalString __uri    = default;
            IntPtr        __retval = default;

            try
            {
                __uri = MarshalString.CreateMarshaler(uri);
                global::WinRT.ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateUri_0(ThisPtr, MarshalString.GetAbi(__uri), out __retval));
                return(ObjectReference <IUnknownVftbl> .Attach(ref __retval));
            }
            finally
            {
                MarshalString.DisposeMarshaler(__uri);
            }
        }
Пример #3
0
                public unsafe new IntPtr CreateLanguage(string languageTag)
                {
                    MarshalString __languageTag = default;
                    IntPtr        __retval      = default;

                    try
                    {
                        __languageTag = MarshalString.CreateMarshaler(languageTag);
                        global::WinRT.ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateLanguage_0(ThisPtr, MarshalString.GetAbi(__languageTag), out __retval));
                        return(__retval);
                    }
                    finally
                    {
                        MarshalString.DisposeMarshaler(__languageTag);
                    }
                }
Пример #4
0
 internal void Dispose()
 {
     MarshalString.DisposeMarshaler(Name);
 }