public MemberReference TransformWith(IGenericContext context) { if (this.IsGenericMethod) { MethodSpecification copy = this.MemberwiseClone() as MethodSpecification; copy._context = context; copy._metadatarow = this._metadatarow; copy._genericArgs = _netheader.BlobHeap.ReadGenericArgumentsSignature(copy.SpecificationSignature, context); uint signature = 0; if (copy.OriginalMethod.IsDefinition) { signature = Convert.ToUInt32(copy.OriginalMethod.MetaDataRow.Parts[4]); } else { signature = Convert.ToUInt32(copy._originalmethod.MetaDataRow.Parts[2]); } copy._signature = _netheader.BlobHeap.ReadMemberRefSignature(signature, copy) as MethodSignature; return(copy); } return(this); }
private void UpdateMethodSpec(Workspace workspace, MethodSpecification methodSpec) { methodSpec.MetaDataRow.Parts[0] = GetMemberIndex(workspace, Constructor.OriginalAssembly.NETHeader.TablesHeap.MethodDefOrRef, methodSpec.OriginalMethod); // TODO: serialize blob. }