Exemple #1
0
        public NativeObject GetNativeObject()
        {
            if (!(this._pointer != UIntPtr.Zero))
            {
                return((NativeObject)null);
            }
            NativeObject target = (NativeObject)this._weakReferenceCache.Target;

            if (target != (NativeObject)null)
            {
                return(target);
            }
            NativeObject nativeObject = (NativeObject)this._constructorInfo.Invoke(new object[1]
            {
                (object)this._pointer
            });

            this._weakReferenceCache.Target = (object)nativeObject;
            return(nativeObject);
        }
Exemple #2
0
 internal static T CreateNativeObjectWrapper <T>(NativeObjectPointer nativeObjectPointer) where T : NativeObject => (T)NativeObject.CreateNativeObjectWrapper(nativeObjectPointer);