예제 #1
0
 /// <summary>
 /// Reads a <c>TypeDefOrRef</c>
 /// </summary>
 /// <returns>A <see cref="ITypeDefOrRef"/> instance</returns>
 ITypeDefOrRef ReadTypeDefOrRef()
 {
     if (!reader.TryReadCompressedUInt32(out uint codedToken))
     {
         return(null);
     }
     return(helper.ResolveTypeDefOrRef(codedToken, gpContext));
 }
예제 #2
0
        /// <summary>
        /// Reads a <c>TypeDefOrRef</c>
        /// </summary>
        /// <returns>A <see cref="ITypeDefOrRef"/> instance</returns>
        ITypeDefOrRef ReadTypeDefOrRef()
        {
            uint codedToken;

            if (!reader.ReadCompressedUInt32(out codedToken))
            {
                return(null);
            }
            return(helper.ResolveTypeDefOrRef(codedToken));
        }
예제 #3
0
 ITypeDefOrRef ReadTypeDefOrRef(bool allowTypeSpec)
 {
     if (!reader.TryReadCompressedUInt32(out uint codedToken))
     {
         return(null);
     }
     if (!allowTypeSpec && CodedToken.TypeDefOrRef.Decode2(codedToken).Table == Table.TypeSpec)
     {
         return(null);
     }
     return(helper.ResolveTypeDefOrRef(codedToken, default));
 }
예제 #4
0
        TypeSig ReadTypeDefOrRefSig()
        {
            uint codedToken;

            if (!reader.TryReadCompressedUInt32(out codedToken))
            {
                return(null);
            }
            ISignatureReaderHelper helper = module;
            var tdr = helper.ResolveTypeDefOrRef(codedToken, gpContext);

            return(tdr.ToTypeSig());
        }
예제 #5
0
        ITypeDefOrRef ReadTypeDefOrRef()
        {
            uint codedToken;

            if (!reader.TryReadCompressedUInt32(out codedToken))
            {
                return(null);
            }
            ISignatureReaderHelper helper = module;
            var tdr     = helper.ResolveTypeDefOrRef(codedToken, gpContext);
            var corType = module.CorLibTypes.GetCorLibTypeSig(tdr);

            if (corType != null)
            {
                return(corType.TypeDefOrRef);
            }
            return(tdr);
        }