Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ActivityCreationOptions.cs
Go to the documentation of this file.
3
4namespace System.Diagnostics;
5
6public readonly struct ActivityCreationOptions<T>
7{
9
10 private readonly ActivityContext _context;
11
12 public ActivitySource Source { get; }
13
14 public string Name { get; }
15
16 public ActivityKind Kind { get; }
17
18 public T Parent { get; }
19
21
23
25 {
26 get
27 {
28 if (_samplerTags == null)
29 {
31 }
32 return _samplerTags;
33 }
34 }
35
48
49 internal ActivityIdFormat IdFormat { get; }
50
52 {
53 Source = source;
54 Name = name;
55 Kind = kind;
56 Parent = parent;
57 Tags = tags;
58 Links = links;
61 {
63 }
64 _samplerTags = null;
66 {
68 if (IdFormat == ActivityIdFormat.Unknown)
69 {
71 }
72 }
73 else if (parent is string text && text != null)
74 {
75 if (IdFormat != ActivityIdFormat.Hierarchical)
76 {
78 {
80 }
81 if (IdFormat == ActivityIdFormat.Unknown)
82 {
83 IdFormat = ActivityIdFormat.Hierarchical;
84 }
85 }
86 else
87 {
88 _context = default(ActivityContext);
89 }
90 }
91 else
92 {
93 _context = default(ActivityContext);
94 if (IdFormat == ActivityIdFormat.Unknown)
95 {
96 IdFormat = ((Activity.Current != null) ? Activity.Current.IdFormat : Activity.DefaultIdFormat);
97 }
98 }
99 }
100
102 {
103 return _samplerTags;
104 }
105
107 {
108 return _context;
109 }
110}
static bool ForceDefaultIdFormat
Definition Activity.cs:359
static ? Activity Current
Definition Activity.cs:662
static ActivityIdFormat DefaultIdFormat
Definition Activity.cs:609
static ? Func< ActivityTraceId > TraceIdGenerator
Definition Activity.cs:606
static bool TryParse(string? traceParent, string? traceState, out ActivityContext context)
ActivityCreationOptions(ActivitySource source, string name, T parent, ActivityKind kind, IEnumerable< KeyValuePair< string, object > > tags, IEnumerable< ActivityLink > links, ActivityIdFormat idFormat)
IEnumerable< KeyValuePair< string, object?> >? Tags
static ActivityTraceId CreateRandom()