Exemplo n.º 1
0
        internal CTRunDelegateCallbacks GetCallbacks()
        {
            var callbacks = new CTRunDelegateCallbacks()
            {
                version = CTRunDelegateVersion.Version1,
                dealloc = Deallocate,
            };

            var        flags = BindingFlags.Public | BindingFlags.Instance;
            MethodInfo m;

            if ((m = this.GetType().GetMethod("GetAscent", flags)) != null &&
                m.DeclaringType != typeof(CTRunDelegateOperations))
            {
                callbacks.getAscent = GetAscent;
            }
            if ((m = this.GetType().GetMethod("GetDescent", flags)) != null &&
                m.DeclaringType != typeof(CTRunDelegateOperations))
            {
                callbacks.getDescent = GetDescent;
            }
            if ((m = this.GetType().GetMethod("GetWidth", flags)) != null &&
                m.DeclaringType != typeof(CTRunDelegateOperations))
            {
                callbacks.getWidth = GetWidth;
            }

            return(callbacks);
        }
Exemplo n.º 2
0
 static extern IntPtr CTRunDelegateCreate(CTRunDelegateCallbacks callbacks, IntPtr refCon);
Exemplo n.º 3
0
        internal CTRunDelegateCallbacks GetCallbacks()
        {
            var callbacks = new CTRunDelegateCallbacks () {
                version = CTRunDelegateVersion.Version1,
                dealloc = Deallocate,
            };

            var flags = BindingFlags.Public | BindingFlags.Instance;
            MethodInfo m;

            if ((m = this.GetType ().GetMethod ("GetAscent", flags)) != null &&
                    m.DeclaringType != typeof (CTRunDelegateOperations)) {
                callbacks.getAscent = GetAscent;
            }
            if ((m = this.GetType ().GetMethod ("GetDescent", flags)) != null &&
                    m.DeclaringType != typeof (CTRunDelegateOperations)) {
                callbacks.getDescent = GetDescent;
            }
            if ((m = this.GetType ().GetMethod ("GetWidth", flags)) != null &&
                    m.DeclaringType != typeof (CTRunDelegateOperations)) {
                callbacks.getWidth = GetWidth;
            }

            return callbacks;
        }
Exemplo n.º 4
0
 static extern IntPtr CTRunDelegateCreate(CTRunDelegateCallbacks callbacks, IntPtr refCon);