Пример #1
0
        static CorFieldInfo ReadFieldInfo(IMetaDataImport mdi, uint token, CorType type)
        {
            if (mdi == null)
            {
                return(null);
            }
            var name = MDAPI.GetFieldName(mdi, token);

            if (name == null)
            {
                return(null);
            }
            var fieldType = GetFieldTypeSig(mdi, token);

            if (fieldType == null)
            {
                return(null);
            }
            var  attrs       = MDAPI.GetFieldAttributes(mdi, token);
            var  constant    = MDAPI.GetFieldConstant(mdi, token, out var constantType);
            var  browseState = GetDebuggerBrowsableState(mdi, token);
            bool compilerGeneratedAttribute = GetCompilerGeneratedAttribute(mdi, token);

            return(new CorFieldInfo(type, token, name, fieldType, attrs, constant, constantType, browseState, compilerGeneratedAttribute));
        }
Пример #2
0
        public FieldAttributes GetAttributes()
        {
            var mod = Module;
            var mdi = mod == null ? null : mod.GetMetaDataInterface <IMetaDataImport>();

            return(MDAPI.GetFieldAttributes(mdi, Token));
        }
Пример #3
0
        void InitNameAndAttrs_NoLock()
        {
            var  mdi   = readerModule.MetaDataImport;
            uint token = OriginalToken.Raw;

            Name            = Utils.GetUTF8String(MDAPI.GetUtf8Name(mdi, OriginalToken.Raw), MDAPI.GetFieldName(mdi, token) ?? string.Empty);
            this.Attributes = origAttrs = MDAPI.GetFieldAttributes(mdi, token);
        }
Пример #4
0
        public DmdFieldDefCOMD(DmdComMetadataReader reader, uint rid, DmdType declaringType, DmdType reflectedType) : base(rid, declaringType, reflectedType)
        {
            this.reader = reader ?? throw new ArgumentNullException(nameof(reader));
            reader.Dispatcher.VerifyAccess();

            uint token = 0x04000000 + rid;

            Attributes = MDAPI.GetFieldAttributes(reader.MetaDataImport, token);
            Name       = MDAPI.GetFieldName(reader.MetaDataImport, token) ?? string.Empty;
            FieldType  = reader.ReadFieldType_COMThread(MDAPI.GetFieldSignatureBlob(reader.MetaDataImport, token), DeclaringType.GetGenericArguments());
        }
Пример #5
0
        static CorFieldInfo ReadFieldInfo(IMetaDataImport mdi, uint token, CorType type)
        {
            if (mdi == null)
            {
                return(null);
            }
            var name = MDAPI.GetFieldName(mdi, token);

            if (name == null)
            {
                return(null);
            }
            var fieldType = GetFieldTypeSig(mdi, token);

            if (fieldType == null)
            {
                return(null);
            }
            var attrs    = MDAPI.GetFieldAttributes(mdi, token);
            var constant = MDAPI.GetFieldConstant(mdi, token, out var constantType);

            return(new CorFieldInfo(type, token, name, fieldType, attrs, constant));
        }
Пример #6
0
 public FieldAttributes GetAttributes() => MDAPI.GetFieldAttributes(Module?.GetMetaDataInterface <IMetaDataImport>(), Token);