Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TraceLoggingTypeInfo.cs
Go to the documentation of this file.
3
5
6internal abstract class TraceLoggingTypeInfo
7{
8 private readonly string name;
9
10 private readonly EventKeywords keywords;
11
12 private readonly EventLevel level = (EventLevel)(-1);
13
14 private readonly EventOpcode opcode = (EventOpcode)(-1);
15
16 private readonly EventTags tags;
17
18 private readonly Type dataType;
19
21
24
25 public string Name => name;
26
28
30
32
33 public EventTags Tags => tags;
34
35 internal Type DataType => dataType;
36
38
40 {
41 if (dataType == null)
42 {
43 throw new ArgumentNullException("dataType");
44 }
46 this.dataType = dataType;
48 }
49
51 {
52 if (dataType == null)
53 {
54 throw new ArgumentNullException("dataType");
55 }
56 if (name == null)
57 {
58 throw new ArgumentNullException("name");
59 }
61 this.name = name;
62 this.keywords = keywords;
63 this.level = level;
64 this.opcode = opcode;
65 this.tags = tags;
66 this.dataType = dataType;
68 }
69
71
72 public abstract void WriteData(PropertyValue value);
73
74 public virtual object GetData(object value)
75 {
76 return value;
77 }
78
79 [RequiresUnreferencedCode("EventSource WriteEvent will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
95}
static TraceLoggingTypeInfo CreateDefaultTypeInfo(Type dataType, List< Type > recursionCheck)
Definition Statics.cs:219
static void CheckName(string name)
Definition Statics.cs:66
void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
TraceLoggingTypeInfo(Type dataType, string name, EventLevel level, EventOpcode opcode, EventKeywords keywords, EventTags tags)
readonly Func< object, PropertyValue > propertyValueFactory
static TraceLoggingTypeInfo GetInstance(Type type, List< Type > recursionCheck)
static Dictionary< Type, TraceLoggingTypeInfo > threadCache
static Func< object, PropertyValue > GetFactory(Type type)