GetEventProps() public method

public GetEventProps ( int mdToken, void &name, EventAttributes &eventAttributes ) : void
mdToken int
name void
eventAttributes EventAttributes
return void
Beispiel #1
0
        internal RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeType.RuntimeTypeCache reflectedTypeCache, out bool isPrivate)
        {
            MetadataImport metadataImport = declaredType.GetRuntimeModule().MetadataImport;

            this.m_token = tkEvent;
            this.m_reflectedTypeCache = reflectedTypeCache;
            this.m_declaringType      = declaredType;
            RuntimeType runtimeType = reflectedTypeCache.GetRuntimeType();

            metadataImport.GetEventProps(tkEvent, out this.m_utf8name, out this.m_flags);
            RuntimeMethodInfo runtimeMethodInfo;

            Associates.AssignAssociates(metadataImport, tkEvent, declaredType, runtimeType, out this.m_addMethod, out this.m_removeMethod, out this.m_raiseMethod, out runtimeMethodInfo, out runtimeMethodInfo, out this.m_otherMethod, out isPrivate, out this.m_bindingFlags);
        }
        internal unsafe RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeType.RuntimeTypeCache reflectedTypeCache, out bool isPrivate)
        {
            RuntimeMethodInfo info;
            MetadataImport    metadataImport = declaredType.GetRuntimeModule().MetadataImport;

            this.m_token = tkEvent;
            this.m_reflectedTypeCache = reflectedTypeCache;
            this.m_declaringType      = declaredType;
            RuntimeType runtimeType = reflectedTypeCache.RuntimeType;

            metadataImport.GetEventProps(tkEvent, out this.m_utf8name, out this.m_flags);
            int associatesCount     = metadataImport.GetAssociatesCount(tkEvent);
            AssociateRecord *result = (AssociateRecord *)stackalloc byte[(((IntPtr)associatesCount) * sizeof(AssociateRecord))];

            metadataImport.GetAssociates(tkEvent, result, associatesCount);
            Associates.AssignAssociates(result, associatesCount, declaredType, runtimeType, out this.m_addMethod, out this.m_removeMethod, out this.m_raiseMethod, out info, out info, out this.m_otherMethod, out isPrivate, out this.m_bindingFlags);
        }
        internal RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeTypeCache reflectedTypeCache, out bool isPrivate)
        {
            Debug.Assert(declaredType != null);
            Debug.Assert(reflectedTypeCache != null);
            Debug.Assert(!reflectedTypeCache.IsGlobal);

            MetadataImport scope = declaredType.GetRuntimeModule().MetadataImport;

            m_token = tkEvent;
            m_reflectedTypeCache = reflectedTypeCache;
            m_declaringType      = declaredType;


            RuntimeType reflectedType = reflectedTypeCache.GetRuntimeType();

            scope.GetEventProps(tkEvent, out m_utf8name, out m_flags);

            Associates.AssignAssociates(scope, tkEvent, declaredType, reflectedType,
                                        out m_addMethod, out m_removeMethod, out m_raiseMethod,
                                        out _, out _, out m_otherMethod, out isPrivate, out m_bindingFlags);
        }
Beispiel #4
0
        internal unsafe RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeType.RuntimeTypeCache reflectedTypeCache, out bool isPrivate)
        {
            MetadataImport metadataImport = declaredType.GetRuntimeModule().MetadataImport;

            this.m_token = tkEvent;
            this.m_reflectedTypeCache = reflectedTypeCache;
            this.m_declaringType      = declaredType;
            RuntimeType runtimeType = reflectedTypeCache.GetRuntimeType();

            metadataImport.GetEventProps(tkEvent, out this.m_utf8name, out this.m_flags);
            MetadataImport scope         = metadataImport;
            int            mdPropEvent   = tkEvent;
            RuntimeType    declaringType = declaredType;
            RuntimeType    reflectedType = runtimeType;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            RuntimeMethodInfo& addOn = @this.m_addMethod;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            RuntimeMethodInfo& removeOn = @this.m_removeMethod;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            RuntimeMethodInfo& fireOn = @this.m_raiseMethod;
            RuntimeMethodInfo  runtimeMethodInfo;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            RuntimeMethodInfo& local = @runtimeMethodInfo;

            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            MethodInfo[]& other = @this.m_otherMethod;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            bool& composedOfAllPrivateMethods = @isPrivate;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            BindingFlags& bindingFlags = @this.m_bindingFlags;

            Associates.AssignAssociates(scope, mdPropEvent, declaringType, reflectedType, addOn, removeOn, fireOn, local, local, other, composedOfAllPrivateMethods, bindingFlags);
        }