Exemplo 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();
     }
 }
Exemplo 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);
            }
        }
Exemplo n.º 3
0
 internal CMClockOrTimebase(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 4
0
 public CGEventSource(IntPtr handle, bool ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo n.º 5
0
 internal CFHTTPAuthentication(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo 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);
     }
 }
Exemplo n.º 8
0
 public SecAccess(IntPtr handle, bool owns = false)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 9
0
 public SafeKeychainItemHandle(IntPtr handle, bool ownsHandle)
     : base(handle, ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 10
0
 internal CGEvent(IntPtr handle, bool ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo n.º 11
0
 internal CFHTTPMessage(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo 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);
     }
 }
Exemplo n.º 14
0
 internal SecIdentity(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 15
0
 internal CGColorConversionInfo(IntPtr handle, bool owns)
 {
     Handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(Handle);
     }
 }
Exemplo n.º 16
0
 internal VTFrameSilo(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
Exemplo n.º 17
0
 internal VTMultiPassStorage(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
Exemplo n.º 18
0
 internal VTSession(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
Exemplo n.º 19
0
 internal CGImageSource(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 20
0
 internal ABRecord(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo n.º 21
0
 public SecKey(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Exemplo n.º 22
0
 internal ABAddressBook(IntPtr handle, bool owns)
 {
     InitConstants.Init();
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
Exemplo 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;
        }
Exemplo n.º 25
0
        internal AUGraph(IntPtr handle, bool owns)
        {
            this.handle = handle;
            if (!owns)
            {
                CFObject.CFRetain(this.handle);
            }

            gcHandle = GCHandle.Alloc(this);
        }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }