コード例 #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;

            MDAPI.GetEventAddRemoveFireTokens(mdi, token, out uint addToken, out uint removeToken, out uint 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);
            }
        }
コード例 #2
0
ファイル: CorTypeDef.cs プロジェクト: manojdjoshi/dnSpy
		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);
		}