Ejemplo n.º 1
0
        internal void InitializeEvent(CorEventDef evt, out MethodDef addMethod, out MethodDef invokeMethod, out MethodDef removeMethod, out ThreadSafe.IList <MethodDef> otherMethods)
        {
            addMethod    = null;
            invokeMethod = null;
            removeMethod = null;
            otherMethods = ThreadSafeListCreator.Create <MethodDef>();

            var  mdi   = readerModule.MetaDataImport;
            uint token = evt.OriginalToken.Raw;

            uint addToken, removeToken, fireToken;

            MDAPI.GetEventAddRemoveFireTokens(mdi, token, out addToken, out removeToken, out fireToken);
            var otherTokens = MDAPI.GetEventOtherMethodTokens(mdi, token);

            var dict = CreateMethodDict();

            addMethod    = Lookup(dict, addToken);
            invokeMethod = Lookup(dict, fireToken);
            removeMethod = Lookup(dict, removeToken);
            foreach (uint otherToken in otherTokens)
            {
                Add(dict, otherMethods, otherToken);
            }
        }