EventAttribute.Keywords 속성

정의

이벤트에 대한 키워드를 가져오거나 설정합니다.

public:
 property System::Diagnostics::Tracing::EventKeywords Keywords { System::Diagnostics::Tracing::EventKeywords get(); void set(System::Diagnostics::Tracing::EventKeywords value); };
public System.Diagnostics.Tracing.EventKeywords Keywords { get; set; }
member this.Keywords : System.Diagnostics.Tracing.EventKeywords with get, set
Public Property Keywords As EventKeywords

속성 값

열거형 값의 비트 조합입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 Keywords 이벤트 키워드를 정의 하는 속성입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 EventSource 클래스입니다.

public static class Keywords
{
    public const EventKeywords Page = (EventKeywords)1;
    public const EventKeywords DataBase = (EventKeywords)2;
    public const EventKeywords Diagnostic = (EventKeywords)4;
    public const EventKeywords Perf = (EventKeywords)8;
}
Public Class Keywords
    Public Const Page As EventKeywords = CType(1, EventKeywords)
    Public Const DataBase As EventKeywords = CType(2, EventKeywords)
    Public Const Diagnostic As EventKeywords = CType(4, EventKeywords)
    Public Const Perf As EventKeywords = CType(8, EventKeywords)
End Class
[Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
public void Failure(string message) { WriteEvent(1, message); }
<[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)> _
Public Sub Failure(ByVal message As String)
    WriteEvent(1, message)
End Sub
[Event(2, Message = "Starting up.", Keywords = Keywords.Perf, Level = EventLevel.Informational)]
public void Startup() { WriteEvent(2); }
<[Event](2, Message:="Starting up.", Keywords:=Keywords.Perf, Level:=EventLevel.Informational)> _
Public Sub Startup()
    WriteEvent(2)
End Sub
[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

적용 대상