Esempio n. 1
0
 public void Close()
 {
     // Windows that do not have a WindowController use released_when_closed
     // if set to true, the call to Close will release the object, and we will
     // end up with a double free.
     //
     // If that is the case, we take a reference first, and to keep the behavior
     // we call Dispose after that.
     if (WindowController == null)
     {
         bool released_when_closed = ReleasedWhenClosed;
         if (released_when_closed)
         {
             CFObject.CFRetain(Handle);
         }
         _Close();
         if (released_when_closed)
         {
             Dispose();
         }
     }
     else
     {
         _Close();
     }
 }
Esempio n. 2
0
        public SecCertificate(X509Certificate certificate)
        {
            if (certificate == null)
            {
                throw new ArgumentNullException("certificate");
            }

#if XAMARIN_APPLETLS
            /*
             * This requires a recent Mono runtime which has the lazily-initialized
             * certifciates in mscorlib.dll, so we can't use it on XM classic.
             *
             * Using 'XAMARIN_APPLETLS' as a conditional because 'XAMCORE_2_0' is
             * defined for tvos and watch, which have a recent-enough runtime.
             */
            handle = certificate.Impl.GetNativeAppleCertificate();
            if (handle != IntPtr.Zero)
            {
                CFObject.CFRetain(handle);
                return;
            }
#endif

            using (NSData cert = NSData.FromArray(certificate.GetRawCertData())) {
                Initialize(cert);
            }
        }
Esempio n. 3
0
 internal CMClockOrTimebase(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 4
0
 public CGEventSource(IntPtr handle, bool ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
 internal CFHTTPAuthentication(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Esempio n. 6
0
 internal CGImageMetadata(IntPtr handle, bool owns)
 {
     Handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(Handle);
     }
 }
 internal SecCertificate(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 8
0
 public SecAccess(IntPtr handle, bool owns = false)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 9
0
 public SafeKeychainItemHandle(IntPtr handle, bool ownsHandle)
     : base(handle, ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 10
0
 internal CGEvent(IntPtr handle, bool ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Esempio n. 11
0
 internal CFHTTPMessage(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Esempio n. 12
0
		internal CTFontDescriptor (IntPtr handle, bool owns)
		{
			if (handle == IntPtr.Zero)
				throw ConstructorError.ArgumentNull (this, "handle");
			this.handle = handle;
			if (!owns)
				CFObject.CFRetain (handle);
		}
 internal CGImageDestination(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 14
0
 internal SecIdentity(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
 internal CGColorConversionInfo(IntPtr handle, bool owns)
 {
     Handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(Handle);
     }
 }
Esempio n. 16
0
 internal VTFrameSilo(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
 internal VTMultiPassStorage(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
Esempio n. 18
0
 internal VTSession(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
Esempio n. 19
0
 internal CGImageSource(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 20
0
 internal ABRecord(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Esempio n. 21
0
 public SecKey(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 22
0
 internal ABAddressBook(IntPtr handle, bool owns)
 {
     InitConstants.Init();
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Esempio n. 23
0
        internal CMSampleBuffer(IntPtr handle, bool owns)
        {
            if (!owns)
            {
                CFObject.CFRetain(handle);
            }

            this.handle = handle;
        }
        internal CMFormatDescription(IntPtr handle, bool owns)
        {
            if (!owns)
            {
                CFObject.CFRetain(handle);
            }

            this.handle = handle;
        }
Esempio n. 25
0
        internal AUGraph(IntPtr handle, bool owns)
        {
            this.handle = handle;
            if (!owns)
            {
                CFObject.CFRetain(this.handle);
            }

            gcHandle = GCHandle.Alloc(this);
        }
Esempio n. 26
0
 internal CTRun(IntPtr handle, bool owns)
 {
     if (handle == IntPtr.Zero)
     {
         throw new ArgumentNullException("handle");
     }
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 27
0
 internal CTFontCollection(IntPtr handle, bool owns)
 {
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.ArgumentNull(this, "handle");
     }
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 28
0
        internal SecPolicy(IntPtr handle, bool owns = false)
        {
            if (handle == IntPtr.Zero)
            {
                throw new Exception("Invalid handle");
            }

            this.handle = handle;
            if (!owns)
            {
                CFObject.CFRetain(handle);
            }
        }
Esempio n. 29
0
        internal SecCertificate(X509CertificateImpl impl)
        {
            handle = impl.GetNativeAppleCertificate();
            if (handle != IntPtr.Zero)
            {
                CFObject.CFRetain(handle);
                return;
            }

            using (NSData cert = NSData.FromArray(impl.GetRawCertData())) {
                Initialize(cert);
            }
        }
Esempio n. 30
0
        internal SecCertificate(IntPtr handle, bool owns)
        {
            if (handle == IntPtr.Zero)
            {
                throw new Exception("Invalid handle");
            }

            this.handle = handle;
            if (!owns)
            {
                CFObject.CFRetain(handle);
            }
        }