EventSource::Write<T> Method (String^, EventSourceOptions%, Guid%, Guid%, T%)
Writes an event with the specified name, options, related activity and event data.
Assembly: mscorlib (in mscorlib.dll)
public: generic<typename T> void Write( String^ eventName, EventSourceOptions% options, Guid% activityId, Guid% relatedActivityId, T% data )
Parameters
- eventName
-
Type:
System::String^
The name of the event.
- options
-
Type:
System.Diagnostics.Tracing::EventSourceOptions%
The event options.
- activityId
-
Type:
System::Guid%
The ID of the activity associated with the event.
- relatedActivityId
-
Type:
System::Guid%
The ID of an associated activity, or Empty if there is no associated activity.
- data
-
Type:
T%
The event data. This type must be an anonymous type or marked with the EventDataAttribute attribute.
Type Parameters
- T
The type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute.
If eventName is null, the event name is automatically derived from the type T’s event data (Name) or determined based on the name of type T. The public instance properties of data will be written recursively to create the event fields.
Available since 10
.NET Framework
Available since 4.6