Пример #1
0
        void InitNameAndAttrs_NoLock()
        {
            var  mdi   = readerModule.MetaDataImport;
            uint token = OriginalToken.Raw;

            Name       = Utils.GetUTF8String(MDAPI.GetUtf8Name(mdi, OriginalToken.Raw), MDAPI.GetEventName(mdi, token) ?? string.Empty);
            Attributes = MDAPI.GetEventAttributes(mdi, token);
            uint eventType = MDAPI.GetEventTypeToken(mdi, token);

            EventType = readerModule.ResolveTypeDefOrRefInternal(eventType, new GenericParamContext(ownerType));
        }
Пример #2
0
        public DmdEventDefCOMD(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 = 0x14000000 + rid;

            Name       = MDAPI.GetEventName(reader.MetaDataImport, token) ?? string.Empty;
            Attributes = MDAPI.GetEventAttributes(reader.MetaDataImport, token);
            var eventTypeToken = MDAPI.GetEventTypeToken(reader.MetaDataImport, token);

            EventHandlerType = reader.ResolveType((int)eventTypeToken, DeclaringType !.GetGenericArguments(), null, DmdResolveOptions.None) ?? reader.Module.AppDomain.System_Void;
        }
Пример #3
0
        public CorType GetEventType()
        {
            var mod = Module;
            var mdi = mod?.GetMetaDataInterface <IMetaDataImport>();

            if (mdi == null)
            {
                return(null);
            }

            uint eventType = MDAPI.GetEventTypeToken(mdi, Token);

            return(mod.CreateTypeFromTypeDefOrRef(eventType));
        }