public IDictionary Load(string filename) { var dbcStream = this.dbcProvider.StreamForFilename(filename); var dbdStream = this.dbdProvider.StreamForFilename(filename); var builder = new DBCDBuilder(); var definition = builder.Build(dbcStream, dbdStream); var type = typeof(Storage <>).MakeGenericType(definition); return((IDictionary)Activator.CreateInstance(type, dbcStream)); }
public IDBCDStorage Load(string tableName, string build = null, Locale locale = Locale.None) { var dbcStream = this.dbcProvider.StreamForTableName(tableName, build); var dbdStream = this.dbdProvider.StreamForTableName(tableName, build); var builder = new DBCDBuilder(locale); var dbReader = new DBReader(dbcStream); var definition = builder.Build(dbReader, dbdStream, tableName, build); var type = typeof(DBCDStorage <>).MakeGenericType(definition.Item1); return((IDBCDStorage)Activator.CreateInstance(type, new object[2] { dbReader, definition.Item2 })); }