internal IMethodContract Map(IMethodContract methodContract) { var result = new CodeAndContractDeepCopier(host).Copy(methodContract); var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity); return(rewriter.Rewrite(result)); }
internal ITypeReference Map(ITypeReference typeReference) { var result = new MetadataDeepCopier(host).Copy(typeReference); var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity); return(rewriter.Rewrite(result)); }
internal ITypeContract Map(ITypeDefinition newParentTypeDefinition, ITypeContract typeContract) { var result = new CodeAndContractDeepCopier(host).Copy(typeContract); // Need to reparent any ContractFields and ContractMethods so that their ContainingTypeDefinition // points to the correct type foreach (var m in result.ContractMethods) { var mutableMethod = (MethodDefinition)m; mutableMethod.ContainingTypeDefinition = newParentTypeDefinition; } foreach (var f in result.ContractFields) { var mutableField = (FieldDefinition)f; mutableField.ContainingTypeDefinition = newParentTypeDefinition; } var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity); var iTypeContract = rewriter.Rewrite(result); return(iTypeContract); }
public ITypeContract Map(ITypeContract typeContract) { var result = new CodeAndContractDeepCopier(host).Copy(typeContract); var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity); return rewriter.Rewrite(result); }
public ITypeReference Map(ITypeReference typeReference) { var result = new MetadataDeepCopier(host).Copy(typeReference); var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity); return rewriter.Rewrite(result); }