3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 /*============================================================
11 ** This public abstract class defines the methods / properties
12 ** that all events should support.
14 ============================================================*/
16 using System.Collections;
17 using System.Collections.Generic;
18 using System.Security.Principal;
19 using System.Diagnostics.CodeAnalysis;
21 namespace System.Diagnostics.Eventing.Reader {
24 /// Represents an event obtained from an EventReader.
26 [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
27 public abstract class EventRecord : IDisposable {
28 public abstract int Id { get; }
29 public abstract byte? Version { get; }
30 public abstract byte? Level { get; }
31 public abstract int? Task { get; }
33 [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
34 public abstract short? Opcode { get; }
35 public abstract long? Keywords { get; }
37 public abstract long? RecordId { get; }
39 public abstract string ProviderName { get; }
40 public abstract Guid? ProviderId { get; }
41 public abstract string LogName { get; }
43 public abstract int? ProcessId { get; }
44 public abstract int? ThreadId { get; }
45 public abstract string MachineName { get; }
46 public abstract SecurityIdentifier UserId { get; }
47 public abstract DateTime? TimeCreated { get; }
49 public abstract Guid? ActivityId { get; }
50 public abstract Guid? RelatedActivityId { get; }
51 public abstract int? Qualifiers { get; }
53 public abstract string FormatDescription();
54 public abstract string FormatDescription(IEnumerable<object> values);
56 public abstract string LevelDisplayName { get; }
58 [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
59 public abstract string OpcodeDisplayName { get; }
60 public abstract string TaskDisplayName { get; }
61 public abstract IEnumerable<string> KeywordsDisplayNames { get; }
63 public abstract EventBookmark Bookmark { get; }
65 public abstract IList<EventProperty> Properties { get; }
67 public abstract string ToXml();
69 public void Dispose() {
71 GC.SuppressFinalize(this);
73 protected virtual void Dispose(bool disposing) { }