Пример #1
0
        public TypeWeaver(TypeDefinition originTypeDef, TypeDefinition destinationTypeDef, CecilCopier copier)
        {
            this.DestinationType = destinationTypeDef;
            this.OriginType      = originTypeDef;
            this.copier          = copier;

            constants = new Dictionary <FieldReference, object>();
        }
Пример #2
0
        public void AddAssembly(string origAssemblyPath)
        {
            var origAssembly = CecilUtils.GetAssemblyDef(origAssemblyPath);
            var copier       = new CecilCopier(origAssembly.MainModule, destAssembly.MainModule);

            foreach (var origType in origAssembly.MainModule.Types)
            {
                if (origType.BaseType != null)
                {
                    copier.Copy(origType);
                }
            }

            copier.Process();
        }