public MethodSignature(SignatureHeader header, TType returnType, int requiredParameterCount, int genericParameterCount, ImmutableArray <TType> parameterTypes) { Header = header; ReturnType = returnType; GenericParameterCount = genericParameterCount; RequiredParameterCount = requiredParameterCount; ParameterTypes = parameterTypes; }
/// <summary> /// Determines if the member reference is to a method or field. /// </summary> /// <exception cref="BadImageFormatException">The member reference signature is invalid.</exception> public MemberReferenceKind GetKind() { BlobReader blobReader = _reader.GetBlobReader(this.Signature); SignatureHeader header = blobReader.ReadSignatureHeader(); switch (header.Kind) { case SignatureKind.Method: return(MemberReferenceKind.Method); case SignatureKind.Field: return(MemberReferenceKind.Field); default: throw new BadImageFormatException(); } }
/// <summary> /// Determines the kind of signature, which can be <see cref="SignatureKind.Method"/> or <see cref="SignatureKind.LocalVariables"/> /// </summary> /// <exception cref="BadImageFormatException">The signature is invalid.</exception> public StandaloneSignatureKind GetKind() { BlobReader blobReader = _reader.GetBlobReader(this.Signature); SignatureHeader header = blobReader.ReadSignatureHeader(); switch (header.Kind) { case SignatureKind.Method: return(StandaloneSignatureKind.Method); case SignatureKind.LocalVariables: return(StandaloneSignatureKind.LocalVariables); default: throw new BadImageFormatException(); } }