EventOpcode 枚举

定义

定义标准操作代码,事件源将其添加到事件。

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

字段

DataCollectionStart 3

跟踪集合启动事件。

DataCollectionStop 4

跟踪集合停止事件。

Extension 5

扩展事件。

Info 0

信息性事件。

Receive 240

在应用程序中的一个活动收到数据时发布的事件。

Reply 6

在应用程序中的活动答复事件后发布的事件。

Resume 7

在应用程序中的活动从挂起状态恢复后发布的事件。 该事件应执行具有 Suspend 操作代码的事件。

Send 9

在应用程序中的一个活动将数据或系统资源传输到另一个活动时发布的事件。

Start 1

在应用程序启动新事务或活动时发布的事件。 当多个具有 Start 码的事件相继发生而没有具有 Stop 码的插入事件时,此操作代码可以嵌入到另一个事务或活动中。

Stop 2

在应用程序中的活动或事务结束时发布的事件。 此事件与具有 Start 操作码的最后一个未成对的事件对应。

Suspend 8

在应用程序中的活动挂起时发布的事件。

示例

以下示例演示如何使用 Start 枚举成员指定启动操作。 此示例是为类提供的大型示例的 EventSource 一部分。

[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 枚举成员指定停止操作。 此示例是为类提供的大型示例的 EventSource 一部分。

[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

适用于