/// <inheritdoc />
        protected override GenericInstanceMethodSignature GetSignature()
        {
            var reader = _parentModule.DotNetDirectory.Metadata
                         .GetStream <BlobStream>()
                         .GetBlobReaderByIndex(_row.Instantiation);

            return(GenericInstanceMethodSignature.FromReader(_parentModule, reader));
        }
Exemplo n.º 2
0
        internal MethodSpecification(MetadataHeader header, MetadataToken token, MetadataRow <uint, uint> row)
            : base(header, token, row)
        {
            var tableStream = header.GetStream <TableStream>();

            _method = new LazyValue <IMethodDefOrRef>(() =>
            {
                var methodToken = tableStream.GetIndexEncoder(CodedIndex.MethodDefOrRef).DecodeIndex(row.Column1);
                return(methodToken.Rid != 0 ? (IMethodDefOrRef)tableStream.ResolveMember(methodToken) : null);
            });

            _signature = new LazyValue <GenericInstanceMethodSignature>(() =>
                                                                        GenericInstanceMethodSignature.FromReader(header, header.GetStream <BlobStream>().CreateBlobReader(row.Column2)));
        }
Exemplo n.º 3
0
        internal MethodSpecification(MetadataImage image, MetadataRow <uint, uint> row)
            : base(row.MetadataToken)
        {
            _image  = image;
            _method = new LazyValue <IMethodDefOrRef>(() =>
            {
                var encoder     = image.Header.GetStream <TableStream>().GetIndexEncoder(CodedIndex.MethodDefOrRef);
                var methodToken = encoder.DecodeIndex(row.Column1);

                return(image.TryResolveMember(methodToken, out var member) ? (IMethodDefOrRef)member : null);
            });

            _signature = new LazyValue <GenericInstanceMethodSignature>(() =>
                                                                        GenericInstanceMethodSignature.FromReader(image, image.Header.GetStream <BlobStream>().CreateBlobReader(row.Column2)));

            CustomAttributes = new CustomAttributeCollection(this);
        }