EventOpcode Enumeration

.NET Framework 4.5

Defines the standard operation codes that the event source attaches to events.

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

public enum EventOpcode

Member nameDescription
Supported in .NET for Windows Store appsDataCollectionStartA trace collection start event.
Supported in .NET for Windows Store appsDataCollectionStopA trace collection stop event.
Supported in .NET for Windows Store appsExtensionAn extension event.
Supported in .NET for Windows Store appsInfoAn informational event.
Supported in .NET for Windows Store appsReceiveAn event that is published when one activity in an application receives data.
Supported in .NET for Windows Store appsReplyAn event that is published after an activity in an application replies to an event.
Supported in .NET for Windows Store appsResumeAn event that is published after an activity in an application resumes from a suspended state. The event should follow an event that has the Suspend operation code.
Supported in .NET for Windows Store appsSendAn event that is published when one activity in an application transfers data or system resources to another activity.
Supported in .NET for Windows Store appsStartAn event that is published when an application starts a new transaction or activity. This operation code can be embedded within another transaction or activity when multiple events that have the Start code follow each other without an intervening event that has a Stop code.
Supported in .NET for Windows Store appsStopAn event that is published when an activity or a transaction in an application ends. The event corresponds to the last unpaired event that has a Start operation code.
Supported in .NET for Windows Store appsSuspendAn event that is published when an activity in an application is suspended.

The following example shows how to use the EventOpcode class to specify event operation codes. This code example is part of a larger example provided for the EventSource class.

[Event(3, Message = "loading page {1} activityID={0}", Opcode = EventOpcode.Start, 
    Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStart(int ID, string url) { if (IsEnabled()) WriteEvent(3, ID, url); }
[Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft