示例#1
0
        internal IMethodContract Map(IMethodContract methodContract)
        {
            var result   = new CodeAndContractDeepCopier(host).Copy(methodContract);
            var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity);

            return(rewriter.Rewrite(result));
        }
示例#2
0
        internal ITypeReference Map(ITypeReference typeReference)
        {
            var result   = new MetadataDeepCopier(host).Copy(typeReference);
            var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity);

            return(rewriter.Rewrite(result));
        }
示例#3
0
        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);
        }
示例#4
0
 public ITypeContract Map(ITypeContract typeContract)
 {
     var result = new CodeAndContractDeepCopier(host).Copy(typeContract);
       var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity);
       return rewriter.Rewrite(result);
 }
示例#5
0
 public ITypeReference Map(ITypeReference typeReference)
 {
     var result = new MetadataDeepCopier(host).Copy(typeReference);
       var rewriter = new ActualMutator(host, targetUnit, sourceUnitIdentity);
       return rewriter.Rewrite(result);
 }