public override byte[] ResolveSignature(int metadataToken) { MetadataToken tk = new MetadataToken(metadataToken); if (!MetadataImport.IsValidToken(tk)) { throw new ArgumentOutOfRangeException( nameof(metadataToken), SR.Format(SR.Argument_InvalidToken, tk, this) ); } if ( !tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef ) { throw new ArgumentException( SR.Format(SR.Argument_InvalidToken, tk, this), nameof(metadataToken) ); } ConstArray signature; if (tk.IsMemberRef) { signature = MetadataImport.GetMemberRefProps(metadataToken); } else { signature = MetadataImport.GetSignatureFromToken(metadataToken); } byte[] sig = new byte[signature.Length]; for (int i = 0; i < signature.Length; i++) { sig[i] = signature[i]; } return(sig); }
public byte[] ResolveSignature(int metadataToken) { MetadataToken tk = new MetadataToken(metadataToken); if (!MetadataImport.IsValidToken(tk)) { throw new ArgumentOutOfRangeException("metadataToken", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_InvalidToken", tk, this))); } if (!tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef) { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_InvalidToken", tk, this)), "metadataToken"); } ConstArray signature; if (tk.IsMemberRef) { signature = MetadataImport.GetMemberRefProps(metadataToken); } else { signature = MetadataImport.GetSignatureFromToken(metadataToken); } byte[] sig = new byte[signature.Length]; for (int i = 0; i < signature.Length; i++) { sig[i] = signature[i]; } return(sig); }