public TypeWeaver(TypeDefinition originTypeDef, TypeDefinition destinationTypeDef, CecilCopier copier) { this.DestinationType = destinationTypeDef; this.OriginType = originTypeDef; this.copier = copier; constants = new Dictionary <FieldReference, object>(); }
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(); }