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