EventOpcode Enumeration

.NET Framework (current version)
 

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
DataCollectionStart

A trace collection start event.

DataCollectionStop

A trace collection stop event.

Extension

An extension event.

Info

An informational event.

Receive

An event that is published when one activity in an application receives data.

Reply

An event that is published after an activity in an application replies to an event.

Resume

An 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.

Send

An event that is published when one activity in an application transfers data or system resources to another activity.

Start

An 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.

Stop

An 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.

Suspend

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: