-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
EventLogQuery.cs
49 lines (40 loc) · 1.47 KB
/
EventLogQuery.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.Eventing.Reader
{
/// <summary>
/// Allows a user to define events of interest. An instance of this
/// class is passed to an EventReader to actually obtain the EventRecords.
/// The EventLogQuery can be as simple specifying that all events are of
/// interest, or it can contain query / xpath expressions that indicate exactly
/// what characteristics events should have.
/// </summary>
public class EventLogQuery
{
public EventLogQuery(string path, PathType pathType)
: this(path, pathType, null)
{
}
public EventLogQuery(string path, PathType pathType, string query)
{
Session = EventLogSession.GlobalSession;
Path = path; // can be null
ThePathType = pathType;
if (query == null)
{
if (path == null)
throw new ArgumentNullException(nameof(path));
}
else
{
Query = query;
}
}
public EventLogSession Session { get; set; }
public bool TolerateQueryErrors { get; set; }
public bool ReverseDirection { get; set; }
internal string Path { get; }
internal PathType ThePathType { get; }
internal string Query { get; }
}
}