示例#1
0
文件: Table.cs 项目: rjamesnw/CoreXT
        // --------------------------------------------------------------------------------------------------------------------

        /// <summary> Configure a table component with a data table instance. </summary>
        /// <typeparam name="TEntity"> Type of the entity. </typeparam>
        /// <param name="id">    The identifier. </param>
        /// <param name="table"> The data table to use. </param>
        /// <returns> A Table. </returns>
        public Table Configure <TEntity>(string id, IVariantTable <TEntity> table) where TEntity : class, new()
        {
            EnableAutomaticID = true;
            ID        = id;
            DataTable = table;
            return(this);
        }
示例#2
0
文件: Table.cs 项目: rjamesnw/CoreXT
        /// <summary> Configure a table component with a data table instance. </summary>
        /// <typeparam name="TEntity"> Type of the entity. </typeparam>
        /// <param name="id">       The data table to use. </param>
        /// <param name="entities"> The entities. </param>
        /// <returns> A Table. </returns>
        public Table Configure <TEntity>(string id, IEnumerable <TEntity> entities) where TEntity : class, new()
        {
            EnableAutomaticID = true;
            ID = id;
            var table = new Table <TEntity>(ServiceProvider);

            table.Entities = entities;
            DataTable      = table;
            return(this);
        }
示例#3
0
        /// <summary>
        /// Overwrites another table with this table's values.
        /// </summary>
        public void CopyTo(IVariantTable inTarget)
        {
            VariantTable validTarget = inTarget as VariantTable;

            if (validTarget == null)
            {
                throw new ArgumentException("Invalid copy target", "inTarget");
            }

            m_Values.CopyTo(validTarget.m_Values);
            validTarget.m_Optimized = m_Optimized;
        }
示例#4
0
 public VariantTable(StringHash32 inName, VariantTable inBase)
     : this(inName)
 {
     m_Base = inBase;
 }
示例#5
0
 /// <summary>
 /// Clears values and base.
 /// </summary>
 public void Reset()
 {
     Clear();
     m_Base = null;
 }