本文整理汇总了C#中BaseEvent.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# BaseEvent.GetType方法的具体用法?C# BaseEvent.GetType怎么用?C# BaseEvent.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseEvent
的用法示例。
在下文中一共展示了BaseEvent.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToEventData
public static EventData ToEventData(BaseEvent evnt, IDictionary<string, object> headers)
{
var data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(evnt, SerializerSettings));
var eventHeaders = new Dictionary<string, object>(headers)
{
{
"EventClrTypeName", evnt.GetType().AssemblyQualifiedName
}
};
var metadata = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(eventHeaders, SerializerSettings));
var typeName = TypeToCamelcase(evnt.GetType());
return new EventData(evnt.EventId, typeName, true, data, metadata);
}
示例2: Send
/// <summary>
/// Perform actual send
/// </summary>
private void Send(IDebugProcess2 process, IDebugProgram2 program, IDebugThread2 thread, BaseEvent @event)
{
var guid = @event.IID;
DLog.Debug(DContext.VSDebuggerEvent, "DebugEngine Event {0} {1}", @event.GetType().Name, guid);
var rc = callback.Event(engine, process, program, thread, @event, ref guid, (uint)@event.Attributes);
if (!ErrorHandler.Succeeded(rc))
{
DLog.Error(DContext.VSDebuggerEvent, "DebugEngine Event failed {0}", rc);
}
}
示例3: SendEvent
/// <summary>
/// Send the given event to all event sinks
/// </summary>
private void SendEvent(IDebugCoreServer2 server, IDebugPort2 port, IDebugProcess2 process, IDebugProgram2 program, BaseEvent @event)
{
var iid = @event.IID;
DLog.Debug(DContext.VSDebuggerEvent, "DebugPort Event {0} {1}", @event.GetType().Name, iid);
foreach (var eventSink in eventSinks)
{
var events = eventSink as IDebugPortEvents2;
if (events != null)
{
var rc = events.Event(server, port, process, program, @event, ref iid);
if (!ErrorHandler.Succeeded(rc))
{
DLog.Error(DContext.VSDebuggerEvent, "DebugPort Event failed {0}", rc);
}
}
}
}