コード例 #1
0
 public TableCollection(MapInfoSession miSession)
 {
     this.mi_session   = miSession;
     this.tableinfo    = new TableInfoWrapper(miSession);
     this.mapbasic     = new MapbasicWrapper(miSession);
     this.tablefactory = new TableFactory(miSession);
 }
コード例 #2
0
        /// <summary>
        /// Returns a new <see cref="Table{TEntity}"/> using the <typeparamref name="TEntity"/> as the
        /// tables row entity.
        ///
        /// <para>This function is usful if you have retrived an table from a <see cref="MapInfoSession"/>'s  <see cref="TableCollection"/>
        /// which are stored as <see cref="Table"/> but you know the entity type for it.</para>
        /// </summary>
        /// <typeparam name="TEntity">The type to use as the entity type for the table.</typeparam>
        /// <returns>A new <see cref="Table{TEntity}"/> for the same table as this <see cref="Table"/>.</returns>
        public Table <TEntity> ToGenericTable <TEntity>()
            where TEntity : BaseEntity, new()
        {
            TableFactory tabFactory = new TableFactory(this.MapInfoSession);

            // We can return a new generic version of the table here,
            // because we have overriden Equals and GetHashCode, making the
            // new table and this one equal.
            return(tabFactory.GetTableFor <TEntity>(this.Name));
        }