Export (0) Print
Expand All

EventSource.EventData Structure

.NET Framework 4.6 and 4.5

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

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

protected internal struct EventData

The EventSource.EventData type exposes the following members.

Public propertyDataPointerGets or sets the pointer to the data for the new WriteEvent overload.
Public propertySizeGets or sets the number of payload items in the new WriteEvent overload.

Public methodEqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ValueType.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)

The following example shows how to use the EventSource.EventData structure.

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

.NET Framework

Supported in: 4.6, 4.5

Supported in: Windows Phone 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.
© 2015 Microsoft