EventSource.EventData 结构

定义

提供事件数据用于创建快速 WriteEvent 过载,方法是使用 WriteEventCore(Int32, Int32, EventSource+EventData*) 方法。Provides the event data for creating fast WriteEvent overloads by using the WriteEventCore(Int32, Int32, EventSource+EventData*) method.

public protected value class EventSource::EventData
protected internal struct EventSource.EventData
Protected Friend Structure EventSource.EventData
继承
EventSource.EventData

注解

下面的示例演示如何使用 EventSource.EventData 结构。The following example shows how to use the EventSource.EventData structure.

  
[NonEvent]  
public unsafe void WriteEvent(int eventId, int arg1, int arg2, int arg3, int arg4) {  
    EventData* dataDesc = stackalloc EventProvider.EventData[4];  
  
    dataDesc[0].DataPointer = (IntPtr)(&arg1);  
    dataDesc[0].Size = 4;  
    dataDesc[1].DataPointer = (IntPtr)(&arg2);  
    dataDesc[1].Size = 4;  
    dataDesc[2].DataPointer = (IntPtr)(&arg3);  
    dataDesc[2].Size = 4;  
    dataDesc[3].DataPointer = (IntPtr)(&arg4);  
    dataDesc[3].Size = 4;  
  
    WriteEventCore(eventId, 4, (IntPtr)dataDesc);  
}  
  

属性

DataPointer

获取或设置新的 WriteEvent 重载的数据的指针。Gets or sets the pointer to the data for the new WriteEvent overload.

Size

获取或设置新的 WriteEvent 重载中的项目的负载数量。Gets or sets the number of payload items in the new WriteEvent overload.

适用于