当前位置: 首页>>代码示例>>C#>>正文


C# IMetaDataImport.GetEventProps方法代码示例

本文整理汇总了C#中IMetaDataImport.GetEventProps方法的典型用法代码示例。如果您正苦于以下问题:C# IMetaDataImport.GetEventProps方法的具体用法?C# IMetaDataImport.GetEventProps怎么用?C# IMetaDataImport.GetEventProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMetaDataImport的用法示例。


在下文中一共展示了IMetaDataImport.GetEventProps方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEventAddRemoveFireTokens

		public unsafe static bool GetEventAddRemoveFireTokens(IMetaDataImport mdi, uint token, out uint addToken, out uint removeToken, out uint fireToken) {
			addToken = 0;
			removeToken = 0;
			fireToken = 0;
			if (mdi == null)
				return false;
			uint addTokenTmp, removeTokenTmp, fireTokenTmp;
			int hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, new IntPtr(&addTokenTmp), new IntPtr(&removeTokenTmp), new IntPtr(&fireTokenTmp), IntPtr.Zero, 0, IntPtr.Zero);
			if (hr != 0)
				return false;
			addToken = addTokenTmp;
			removeToken = removeTokenTmp;
			fireToken = fireTokenTmp;
			return true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:15,代码来源:MDAPI.cs

示例2: GetEventTypeToken

		public unsafe static uint GetEventTypeToken(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;
			uint tkEventType;
			int hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, new IntPtr(&tkEventType), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			return hr == 0 ? tkEventType : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:MDAPI.cs

示例3: GetEventName

		public unsafe static string GetEventName(IMetaDataImport mdi, uint token) {
			uint chEvent;
			int hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, new IntPtr(&chEvent), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			char[] nameBuf = null;
			if (hr >= 0 && chEvent != 0) {
				nameBuf = new char[chEvent];
				fixed (char* p = &nameBuf[0])
					hr = mdi.GetEventProps(token, IntPtr.Zero, new IntPtr(p), (uint)nameBuf.Length, new IntPtr(&chEvent), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			}
			if (hr < 0)
				return null;

			return chEvent <= 1 ? string.Empty : new string(nameBuf, 0, (int)chEvent - 1);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:14,代码来源:MDAPI.cs

示例4: GetEventAttributes

		public unsafe static EventAttributes GetEventAttributes(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;
			uint dwEventFlags;
			int hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, new IntPtr(&dwEventFlags), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			return hr == 0 ? (EventAttributes)dwEventFlags : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:MDAPI.cs

示例5: GetEventOwnerRid

		public unsafe static uint GetEventOwnerRid(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;
			if (IsGlobal(mdi, token))
				return 1;
			uint ownerToken;
			int hr = mdi.GetEventProps(token, new IntPtr(&ownerToken), IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			if (hr != 0)
				return 0;
			var ownerMdToken = new MDToken(ownerToken);
			return ownerMdToken.Table == Table.TypeDef ? ownerMdToken.Rid : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:12,代码来源:MDAPI.cs

示例6: GetEventOtherMethodTokens

		public unsafe static uint[] GetEventOtherMethodTokens(IMetaDataImport mdi, uint token) {
			uint count;
			int hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, new IntPtr(&count));
			uint[] tokens = null;
			if (hr >= 0 && count != 0) {
				tokens = new uint[count];
				fixed (uint* p = &tokens[0])
					hr = mdi.GetEventProps(token, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, new IntPtr(p), (uint)tokens.Length, new IntPtr(&count));
			}
			if (hr < 0)
				return new uint[0];
			return tokens ?? new uint[0];
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:13,代码来源:MDAPI.cs


注:本文中的IMetaDataImport.GetEventProps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。