EventSource.EventData Structure

EventSource.EventData Structure

.NET Framework (current version)
 

Provides the event data for creating fast WriteEvent overloads by using the WriteEventCore method.

Namespace:   System.Diagnostics.Tracing
Assembly:  mscorlib (in mscorlib.dll)

protected internal struct EventData

NameDescription
System_CAPS_pubpropertyDataPointer

Gets or sets the pointer to the data for the new WriteEvent overload.

System_CAPS_pubpropertySize

Gets or sets the number of payload items in the new WriteEvent overload.

NameDescription
System_CAPS_pubmethodEquals(Object)

Indicates whether this instance and a specified object are equal.(Inherited from ValueType.)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Inherited from ValueType.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the fully qualified type name of this instance.(Inherited from ValueType.)

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);
}

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft