Επεξεργασία

Κοινή χρήση μέσω


EventProvider.WriteTransferEvent Method

Definition

Links events together when tracing events in an end-to-end scenario.

Overloads

WriteTransferEvent(EventDescriptor, Guid, Object[])

Links events together when tracing events in an end-to-end scenario. The event data is specified as an array of objects.

WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr)

Links events together when tracing events in an end-to-end scenario. The event data is specified as a block of memory.

WriteTransferEvent(EventDescriptor, Guid, Object[])

Links events together when tracing events in an end-to-end scenario. The event data is specified as an array of objects.

public:
 bool WriteTransferEvent(System::Diagnostics::Eventing::EventDescriptor % eventDescriptor, Guid relatedActivityId, ... cli::array <System::Object ^> ^ eventPayload);
[System.Security.SecurityCritical]
public bool WriteTransferEvent (ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, Guid relatedActivityId, params object[] eventPayload);
[<System.Security.SecurityCritical>]
member this.WriteTransferEvent : EventDescriptor * Guid * obj[] -> bool
Public Function WriteTransferEvent (ByRef eventDescriptor As EventDescriptor, relatedActivityId As Guid, ParamArray eventPayload As Object()) As Boolean

Parameters

eventDescriptor
EventDescriptor

An instance of EventDescriptor that identifies the event to write.

relatedActivityId
Guid

Activity identifier from the previous component. Use this parameter to link your component's events to the previous component's events.

eventPayload
Object[]

An array of objects that contain the event data to write. The data must be in the order specified in the manifest. The array is limited to 32 objects, of which only eight may be strings. The maximum data size for the event is limited to 64 KB minus the size of the event headers. The event size is less if the session's buffer size is less and the session includes extended data items with the event.

Returns

Is true if the event is written; otherwise, false. If false, call the GetLastWriteEventError() method to determine the cause of the failure.

Attributes

Exceptions

If eventPayload contains too many objects or strings.

Remarks

The method uses the activity ID set in the thread context to identify this component. To set the activity ID, call the SetActivityId method.

If you use the Trace class, you do not use the SetActivityId method to specify the activity ID. Instead, access the CorrelationManager property to get the CorrelationManager object. Then, set the ActivityId property to the activity ID. You must also set the relatedActivityId to a ActivityId value.

Applies to

WriteTransferEvent(EventDescriptor, Guid, Int32, IntPtr)

Links events together when tracing events in an end-to-end scenario. The event data is specified as a block of memory.

protected:
 bool WriteTransferEvent(System::Diagnostics::Eventing::EventDescriptor % eventDescriptor, Guid relatedActivityId, int dataCount, IntPtr data);
[System.Security.SecurityCritical]
protected bool WriteTransferEvent (ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, Guid relatedActivityId, int dataCount, IntPtr data);
[<System.Security.SecurityCritical>]
member this.WriteTransferEvent : EventDescriptor * Guid * int * nativeint -> bool
Protected Function WriteTransferEvent (ByRef eventDescriptor As EventDescriptor, relatedActivityId As Guid, dataCount As Integer, data As IntPtr) As Boolean

Parameters

eventDescriptor
EventDescriptor

An instance of EventDescriptor that identifies the event to write.

relatedActivityId
Guid

Activity identifier from the previous component. Use this parameter to link your component's events to the previous component's events.

dataCount
Int32

Size of the event data to which the data parameter points. The maximum event data size is limited to 64 KB minus the size of the event headers. The event size is less if the session's buffer size is less and the session includes extended data items with the event.

data
IntPtr

nativeint

Pointer to the event data to write.

Returns

Is true if the event is written; otherwise, false. If false, call the GetLastWriteEventError() method to determine the cause of the failure.

Attributes

Remarks

The method uses the activity ID set in the thread context to identify this component. To set the activity ID, call the SetActivityId method.

Applies to