public static void Unpack(Assembly asm, bool insert) { SqlTrans transaction = new SqlTrans(); foreach (Type type in asm.GetExportedTypes()) { if (type.HasInterface <IPacking>()) { IPacking packing = (IPacking)Activator.CreateInstance(type); packing.Unpack(transaction, insert); } } transaction.Commit(); return; }
private static void Unpack(Level level, Assembly asm, BackgroundTask worker, SqlTrans transaction, bool insert) { foreach (Type type in asm.GetExportedTypes()) { if (type.HasInterface <IPacking>() && type != typeof(BasePackage <>)) { IPacking packing = (IPacking)Activator.CreateInstance(type); if (level == packing.Level) { worker.SetProgress(0, string.Format("Unpacking #record={0} of table [{1}].", packing.Count, packing.TableName)); packing.Unpack(worker, transaction, insert); } } } return; }