EventDescriptor EventDescriptor EventDescriptor EventDescriptor Struct

定義

包含定義事件的中繼資料。Contains the metadata that defines an event.

public value class EventDescriptor
public struct EventDescriptor
type EventDescriptor = struct
Public Structure EventDescriptor
繼承
EventDescriptorEventDescriptorEventDescriptorEventDescriptor

備註

此類別代表資訊清單中定義的事件。This class represents an event defined in the manifest. 撰寫資訊清單之後, 您可以使用訊息編譯器 (MC) 來產生資源檔。After writing your manifest, you use the Message Compiler (MC.exe) to generate a resource file. 進程的副產品是標頭檔, 其中包含 C 中的事件描述項, 如下列範例所示。A byproduct of the process is a header file that contains the event descriptor in C, as shown in the following example.

EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ReadEvent = {0x1, 0x0, 0x10, 0x4, 0x0, 0x0, 0x8000000000000005};  

使用描述項的值來建立此類別的實例, 如下列範例所示。Use the values of the descriptor to create an instance of this class, as shown in the following example. 關鍵字是不帶正負號的 long 值, 而且不能直接轉換成 long。您必須使用unchecked language 關鍵字來允許指派。The keyword is an unsigned long value and cannot be cast directly to a long; you must use the unchecked language keyword to allow the assignment.

unchecked  
{  
    readEvent = new EventDescriptor(0x1, 0x0, 0x10, 0x4, 0x0, 0x0, (long)0x8000000000000005);  
}  

呼叫EventProvider.WriteEventEventProvider.WriteEvent方法時, 您會使用描述項。You use the descriptor when calling the EventProvider.WriteEvent or EventProvider.WriteEvent method.

如需撰寫資訊清單和使用訊息編譯器的詳細資訊, 請參閱開發事件發行者For more information on writing the manifest and using the message compiler, see Developing Event Publishers

建構函式

EventDescriptor(Int32, Byte, Byte, Byte, Byte, Int32, Int64) EventDescriptor(Int32, Byte, Byte, Byte, Byte, Int32, Int64) EventDescriptor(Int32, Byte, Byte, Byte, Byte, Int32, Int64) EventDescriptor(Int32, Byte, Byte, Byte, Byte, Int32, Int64)

初始化 EventDescriptor 類別的新執行個體。Initializes a new instance of the EventDescriptor class.

屬性

Channel Channel Channel Channel

從事件描述項擷取通道值。Retrieves the channel value from the event descriptor.

EventId EventId EventId EventId

從事件描述項擷取事件識別項的值。Retrieves the event identifier value from the event descriptor.

Keywords Keywords Keywords Keywords

從事件描述項擷取關鍵字的值。Retrieves the keyword value from the event descriptor.

Level Level Level Level

從事件描述項擷取層級值。Retrieves the level value from the event descriptor.

Opcode Opcode Opcode Opcode

從事件描述項擷取作業代碼值。Retrieves the operation code value from the event descriptor.

Task Task Task Task

從事件描述項擷取工作值。Retrieves the task value from the event descriptor.

Version Version Version Version

從事件描述項擷取版本值。Retrieves the version value from the event descriptor.

適用於