C# Class DSShared.DB.DBTableTypeCache

Singleton class to keep track of open database tables. This is done as an optimization for when we keep an entire table in memory - usually ones that dont change much (flags) so that we dont have to continually pull the same table information from the access database file.
Show file Open project: pmprog/OpenXCOM.Tools

Public Methods

Method Description
CacheHash ( string table, Hashtable hash ) : void

Caches a table using the table parameter as a key

CacheList ( string table, ArrayList list ) : void

Caches an arraylist using the table parameter as a key

CacheTable ( string table ) : DBTableType

Caches a table given its table name. The table must have been registered before calling this or an exception will be raised If the object associated with the table name has not been created yet, it will be created and stored for future use

CacheTable ( DBTableType dbType ) : void

Caches a table given its object

GetHash ( string table ) : Hashtable

A cached database table stored as a hashtable. The keys are determined by autonumber properties that are tagged as such by the objects stored in the table

GetList ( string table ) : ArrayList

A cached database table stored as an array list

GetTableType ( string table ) : Type

Returns the type that has been registered with the table name

GetType ( string table ) : DBTableType

returns a DBTableType object based on the name of the table you have previously cached

RegisterNameType ( string table, Type type ) : void

Sets up a database table with an object type for future cache'ing

Private Methods

Method Description
DBTableTypeCache ( ) : System

Method Details

CacheHash() public method

Caches a table using the table parameter as a key
public CacheHash ( string table, Hashtable hash ) : void
table string Name of the table
hash System.Collections.Hashtable Hashtable of row information
return void

CacheList() public method

Caches an arraylist using the table parameter as a key
public CacheList ( string table, ArrayList list ) : void
table string Name of the table
list System.Collections.ArrayList list of row information
return void

CacheTable() public method

Caches a table given its table name. The table must have been registered before calling this or an exception will be raised If the object associated with the table name has not been created yet, it will be created and stored for future use
public CacheTable ( string table ) : DBTableType
table string Name of the table you wish to access
return DBTableType

CacheTable() public method

Caches a table given its object
public CacheTable ( DBTableType dbType ) : void
dbType DBTableType DBTableType to cache
return void

GetHash() public method

A cached database table stored as a hashtable. The keys are determined by autonumber properties that are tagged as such by the objects stored in the table
public GetHash ( string table ) : Hashtable
table string Name of the table
return System.Collections.Hashtable

GetList() public method

A cached database table stored as an array list
public GetList ( string table ) : ArrayList
table string Name of the table
return System.Collections.ArrayList

GetTableType() public method

Returns the type that has been registered with the table name
public GetTableType ( string table ) : Type
table string Name of the table
return System.Type

GetType() public method

returns a DBTableType object based on the name of the table you have previously cached
public GetType ( string table ) : DBTableType
table string name of the table
return DBTableType

RegisterNameType() public method

Sets up a database table with an object type for future cache'ing
public RegisterNameType ( string table, Type type ) : void
table string Name of the table that this type will be accessed by
type System.Type Object type that will represent this table
return void