mscorlib(4.0.0.0) API with additions
EventCommandEventArgs.cs
2 
4 {
6  [__DynamicallyInvokable]
8  {
9  internal EventSource eventSource;
10 
11  internal EventDispatcher dispatcher;
12 
13  internal EventListener listener;
14 
15  internal int perEventSourceSessionId;
16 
17  internal int etwSessionId;
18 
19  internal bool enable;
20 
21  internal EventLevel level;
22 
23  internal EventKeywords matchAnyKeyword;
24 
25  internal EventCommandEventArgs nextCommand;
26 
29  [__DynamicallyInvokable]
30  public EventCommand Command
31  {
32  [__DynamicallyInvokable]
33  get;
34  internal set;
35  }
36 
39  [__DynamicallyInvokable]
41  {
42  [__DynamicallyInvokable]
43  get;
44  internal set;
45  }
46 
51  [__DynamicallyInvokable]
52  public bool EnableEvent(int eventId)
53  {
54  if (Command != EventCommand.Enable && Command != EventCommand.Disable)
55  {
56  throw new InvalidOperationException();
57  }
58  return eventSource.EnableEventForDispatcher(dispatcher, eventId, value: true);
59  }
60 
65  [__DynamicallyInvokable]
66  public bool DisableEvent(int eventId)
67  {
68  if (Command != EventCommand.Enable && Command != EventCommand.Disable)
69  {
70  throw new InvalidOperationException();
71  }
72  return eventSource.EnableEventForDispatcher(dispatcher, eventId, value: false);
73  }
74 
75  internal EventCommandEventArgs(EventCommand command, IDictionary<string, string> arguments, EventSource eventSource, EventListener listener, int perEventSourceSessionId, int etwSessionId, bool enable, EventLevel level, EventKeywords matchAnyKeyword)
76  {
77  Command = command;
78  Arguments = arguments;
79  this.eventSource = eventSource;
80  this.listener = listener;
81  this.perEventSourceSessionId = perEventSourceSessionId;
82  this.etwSessionId = etwSessionId;
83  this.enable = enable;
84  this.level = level;
85  this.matchAnyKeyword = matchAnyKeyword;
86  }
87  }
88 }
IDictionary< string, string > Arguments
Gets the array of arguments for the callback.
Provides methods for enabling and disabling events from event sources.
Definition: EventListener.cs:8
EventKeywords
Defines the standard keywords that apply to events.
Definition: EventKeywords.cs:6
Definition: __Canon.cs:3
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: EventArgs.cs:9
EventLevel
Identifies the level of an event.
Definition: EventLevel.cs:5
Provides the arguments for the M:System.Diagnostics.Tracing.EventSource.OnEventCommand(System....
bool DisableEvent(int eventId)
Disables the event that have the specified identifier.
Provides the ability to create events for event tracing for Windows (ETW).
Definition: EventSource.cs:21
bool EnableEvent(int eventId)
Enables the event that has the specified identifier.
EventCommand Command
Gets the command for the callback.
The exception that is thrown when a method call is invalid for the object's current state.
EventCommand
Describes the command (P:System.Diagnostics.Tracing.EventCommandEventArgs.Command property) that is p...
Definition: EventCommand.cs:5