Exemple #1
0
 /// <summary>
 /// Конструктор
 /// </summary>
 public TableInfo(string name, string header, GetTableDelegate getTable, string idColName)
 {
     Name = name;
     Header = header;
     GetTable = getTable;
     IDColName = idColName;
 }
        /// <summary>
        /// Uses a delegate to return a table for the given table id.
        /// </summary>
        public CustomVariantResolver SetTable(StringHash32 inTableId, GetTableDelegate inGetter)
        {
            if (inGetter == null)
            {
                throw new ArgumentNullException("inGetter");
            }

            MakeTableRule(inTableId).SetDelegate(inGetter);
            return(this);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
        /// <summary>
        /// Uses a delegate to return a default table if no table id is provided.
        /// </summary>
        public CustomVariantResolver SetDefaultTable(GetTableDelegate inGetter)
        {
            if (inGetter == null)
            {
                throw new ArgumentNullException("inGetter");
            }

            if (m_DefaultTable == null)
            {
                m_DefaultTable = new TableRule();
            }
            m_DefaultTable.SetDelegate(inGetter);
            return(this);
        }
Exemple #7
0
 public Face(GetTableDelegate getTable)
     : this(getTable, null)
 {
 }
Exemple #8
0
 public Face(GetTableDelegate getTable, object context)
     : this(getTable, context, null)
 {
 }
 public void SetDelegate(GetTableWithContextDelegate inDelegate)
 {
     m_Table                    = null;
     m_TableDelegate            = null;
     m_TableWithContextDelegate = inDelegate;
 }
 public void SetConst(VariantTable inTable)
 {
     m_Table                    = inTable;
     m_TableDelegate            = null;
     m_TableWithContextDelegate = null;
 }
 public void Clear()
 {
     m_Table                    = null;
     m_TableDelegate            = null;
     m_TableWithContextDelegate = null;
 }