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

適用於