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 object GetConstant(out CorElementType etype) { var c = MDAPI.GetFieldConstant(Module?.GetMetaDataInterface <IMetaDataImport>(), Token, out etype); if (etype == CorElementType.End) { return(null); } return(c); }
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); }
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))); }
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)); }