Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Core / System / Diagnostics / Eventing / Reader / EventRecord.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 /*============================================================
7 **
8 ** Class: EventRecord
9 **
10 ** Purpose: 
11 ** This public abstract class defines the methods / properties
12 ** that all events should support. 
13 ** 
14 ============================================================*/
15 using System;
16 using System.Collections;
17 using System.Collections.Generic;
18 using System.Security.Principal;
19 using System.Diagnostics.CodeAnalysis;
20
21 namespace System.Diagnostics.Eventing.Reader {
22
23     /// <summary>
24     /// Represents an event obtained from an EventReader.    
25     /// </summary>
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; }
32
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; }
36
37         public abstract long? RecordId { get; }
38
39         public abstract string ProviderName { get; }
40         public abstract Guid? ProviderId { get; }
41         public abstract string LogName { get; }
42
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; }
48
49         public abstract Guid? ActivityId { get; }
50         public abstract Guid? RelatedActivityId { get; }
51         public abstract int? Qualifiers { get; }
52
53         public abstract string FormatDescription();
54         public abstract string FormatDescription(IEnumerable<object> values);
55
56         public abstract string LevelDisplayName { get; }
57
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; }
62
63         public abstract EventBookmark Bookmark { get; }
64
65         public abstract IList<EventProperty> Properties { get; }
66
67         public abstract string ToXml();
68          
69         public void Dispose() {
70             Dispose(true);
71             GC.SuppressFinalize(this);
72         }
73         protected virtual void Dispose(bool disposing) { }
74     }
75 }