Example #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);
        }
Example #2
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;
		}
Example #3
0
		static extern IntPtr CTRunDelegateCreate (CTRunDelegateCallbacks callbacks, IntPtr refCon);
Example #4
0
 static extern IntPtr CTRunDelegateCreate(CTRunDelegateCallbacks callbacks, IntPtr refCon);