EventOpcode 枚举

定义

定义标准操作代码,事件源将其添加到事件。Defines the standard operation codes that the event source attaches to events.

public enum class EventOpcode
public enum EventOpcode
type EventOpcode = 
Public Enum EventOpcode
继承
EventOpcode

字段

DataCollectionStart 3

跟踪集合启动事件。A trace collection start event.

DataCollectionStop 4

跟踪集合停止事件。A trace collection stop event.

Extension 5

扩展事件。An extension event.

Info 0

信息性事件。An informational event.

Receive 240

在应用程序中的一个活动收到数据时发布的事件。An event that is published when one activity in an application receives data.

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. 该事件应执行具有 Suspend 操作代码的事件。The event should follow an event that has the Suspend operation code.

Send 9

在应用程序中的一个活动将数据或系统资源传输到另一个活动时发布的事件。An event that is published when one activity in an application transfers data or system resources to another activity.

Start 1

在应用程序启动新事务或活动时发布的事件。An event that is published when an application starts a new transaction or activity. 当多个具有 Start 码的事件相继发生而没有具有 Stop 码的插入事件时,此操作代码可以嵌入到另一个事务或活动中。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. 此事件与具有 Start 操作码的最后一个未成对的事件对应。The event corresponds to the last unpaired event that has a Start operation code.

Suspend 8

在应用程序中的活动挂起时发布的事件。An event that is published when an activity in an application is suspended.

示例

下面的示例演示如何使用Start枚举成员指定启动操作。The following example shows how to use the Start enumeration member to specify a start operation. 此示例是为EventSource类提供的更大示例的一部分。This 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](3, Message:="loading page {1} activityID={0}", Opcode:=EventOpcode.Start, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)> _
Public Sub PageStart(ByVal ID As Integer, ByVal url As String)
    If IsEnabled() Then
        WriteEvent(3, ID, url)
    End If
End Sub

下面的示例演示如何使用Stop枚举成员来指定停止操作。The following example shows how to use the Stop enumeration member to specify a stop operation. 此示例是为EventSource类提供的更大示例的一部分。This example is part of a larger example provided for the EventSource class.

[Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }
<[Event](4, Opcode:=EventOpcode.Stop, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)> _
Public Sub PageStop(ByVal ID As Integer)
    If IsEnabled() Then
        WriteEvent(4, ID)
    End If
End Sub

适用于