EventOpcode Enum

Definition

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

C#
public enum EventOpcode
Inheritance
EventOpcode

Fields

Name Value Description
Info 0

An informational event.

Start 1

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 2

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.

DataCollectionStart 3

A trace collection start event.

DataCollectionStop 4

A trace collection stop event.

Extension 5

An extension event.

Reply 6

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

Resume 7

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.

Suspend 8

An event that is published when an activity in an application is suspended.

Send 9

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

Receive 240

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

Examples

The following example shows how to use the Start enumeration member to specify a start operation. This example is part of a larger example provided for the EventSource class.

C#
[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); }

The following example shows how to use the Stop enumeration member to specify a stop operation. This example is part of a larger example provided for the EventSource class.

C#
[Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0