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)); }
public FieldAttributes GetAttributes() { var mod = Module; var mdi = mod == null ? null : mod.GetMetaDataInterface <IMetaDataImport>(); return(MDAPI.GetFieldAttributes(mdi, Token)); }
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); }
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()); }
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)); }
public FieldAttributes GetAttributes() => MDAPI.GetFieldAttributes(Module?.GetMetaDataInterface <IMetaDataImport>(), Token);