Пример #1
0
        /// <inheritdoc />
        public MetadataToken GetMethodSpecificationToken(MethodSpecification method)
        {
            var table = Metadata.TablesStream.GetTable <MethodSpecificationRow>(TableIndex.MethodSpec);
            var row   = new MethodSpecificationRow(
                AddMethodDefOrRef(method.Method),
                Metadata.BlobStream.GetBlobIndex(this, method.Signature));

            var token = table.Add(row);

            AddCustomAttributes(token, method);
            return(token);
        }
 /// <summary>
 /// Creates a method specification from a method specification metadata row.
 /// </summary>
 /// <param name="parentModule"></param>
 /// <param name="token">The token to initialize the method specification for.</param>
 /// <param name="row">The metadata table row to base the method specification on.</param>
 public SerializedMethodSpecification(SerializedModuleDefinition parentModule, MetadataToken token, MethodSpecificationRow row)
     : base(token)
 {
     _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule));
     _row          = row;
 }