示例#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();
     }
 }
示例#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);
            }
        }
示例#3
0
 internal CMClockOrTimebase(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#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;
 }
示例#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);
     }
 }
示例#8
0
 public SecAccess(IntPtr handle, bool owns = false)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#9
0
 public SafeKeychainItemHandle(IntPtr handle, bool ownsHandle)
     : base(handle, ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#10
0
 internal CGEvent(IntPtr handle, bool ownsHandle)
 {
     if (!ownsHandle)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
示例#11
0
 internal CFHTTPMessage(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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);
     }
 }
示例#18
0
 internal VTSession(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(this.handle);
     }
 }
示例#19
0
 internal CGImageSource(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#20
0
 internal ABRecord(IntPtr handle, bool owns)
 {
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
示例#21
0
 public SecKey(IntPtr handle, bool owns)
 {
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#22
0
 internal ABAddressBook(IntPtr handle, bool owns)
 {
     InitConstants.Init();
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
     this.handle = handle;
 }
示例#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;
        }
示例#25
0
        internal AUGraph(IntPtr handle, bool owns)
        {
            this.handle = handle;
            if (!owns)
            {
                CFObject.CFRetain(this.handle);
            }

            gcHandle = GCHandle.Alloc(this);
        }
示例#26
0
文件: CTRun.cs 项目: cwensley/monomac
 internal CTRun(IntPtr handle, bool owns)
 {
     if (handle == IntPtr.Zero)
     {
         throw new ArgumentNullException("handle");
     }
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
示例#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);
     }
 }
示例#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);
            }
        }
示例#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);
            }
        }
示例#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);
            }
        }