public Face(GetTableDelegate getTable, object context, ReleaseDelegate destroy) : this(IntPtr.Zero) { if (getTable == null) { throw new ArgumentNullException(nameof(getTable)); } var ctx = DelegateProxies.CreateMulti <GetTableDelegate> ((_, t, __) => getTable.Invoke(this, t, context), context, destroy); Handle = HarfBuzzApi.hb_face_create_for_tables(DelegateProxies.GetTableDelegateProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti); }
public Face(GetTableDelegate getTable, ReleaseDelegate destroy) : this(IntPtr.Zero) { if (getTable == null) { throw new ArgumentNullException(nameof(getTable)); } Handle = HarfBuzzApi.hb_face_create_for_tables( DelegateProxies.GetTableDelegateProxy, DelegateProxies.CreateMultiUserData(getTable, destroy, this), DelegateProxies.ReleaseDelegateProxyForMulti); }
public Face(GetTableDelegate getTable, object context, ReleaseDelegate destroy) : this(IntPtr.Zero) { if (getTable == null) { throw new ArgumentNullException(nameof(getTable)); } var ctx = new NativeDelegateContext( new object[] { context, this }, new Delegate[] { destroy, getTable }); Handle = HarfBuzzApi.hb_face_create_for_tables(table_func, ctx.NativeContext, DestroyFunction.NativePointer); }