示例#1
0
        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;
        }
示例#2
0
        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;
        }