本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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];
}