コード例 #1
0
ファイル: MetaDataUtils.cs プロジェクト: xi4oyu/dnSpy
        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
ファイル: CorField.cs プロジェクト: formylover/dnSpy-1
        public object GetConstant(out CorElementType etype)
        {
            var c = MDAPI.GetFieldConstant(Module?.GetMetaDataInterface <IMetaDataImport>(), Token, out etype);

            if (etype == CorElementType.End)
            {
                return(null);
            }
            return(c);
        }
コード例 #3
0
        public object GetConstant(out CorElementType etype)
        {
            var mod = Module;
            var mdi = mod == null ? null : mod.GetMetaDataInterface <IMetaDataImport>();
            var c   = MDAPI.GetFieldConstant(mdi, token, out etype);

            if (etype == CorElementType.End)
            {
                return(null);
            }
            return(c);
        }
コード例 #4
0
        protected override Constant GetConstant_NoLock()
        {
            var  mdi   = readerModule.MetaDataImport;
            uint token = OriginalToken.Raw;

            var c = MDAPI.GetFieldConstant(mdi, token, out var etype);

            if (etype == CorElementType.End)
            {
                return(null);
            }
            return(readerModule.UpdateRowId(new ConstantUser(c, (ElementType)etype)));
        }
コード例 #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));
        }