Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AddKeyword()

void System.Diagnostics.Tracing.ManifestBuilder.AddKeyword ( string name,
ulong value )
inline

Definition at line 145 of file ManifestBuilder.cs.

146 {
147 if ((value & (value - 1)) != 0L)
148 {
149 ManifestError(SR.Format(SR.EventSource_KeywordNeedPowerOfTwo, "0x" + value.ToString("x", CultureInfo.CurrentCulture), name), runtimeCritical: true);
150 }
151 if ((flags & EventManifestOptions.Strict) != 0)
152 {
153 if (value >= 17592186044416L && !name.StartsWith("Session", StringComparison.Ordinal))
154 {
155 ManifestError(SR.Format(SR.EventSource_IllegalKeywordsValue, name, "0x" + value.ToString("x", CultureInfo.CurrentCulture)));
156 }
157 if (keywordTab != null && keywordTab.TryGetValue(value, out var value2) && !name.Equals(value2, StringComparison.Ordinal))
158 {
159 ManifestError(SR.Format(SR.EventSource_KeywordCollision, name, value2, "0x" + value.ToString("x", CultureInfo.CurrentCulture)));
160 }
161 }
162 if (keywordTab == null)
163 {
165 }
167 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
readonly EventManifestOptions flags
void ManifestError(string msg, bool runtimeCritical=false)
static CultureInfo CurrentCulture

References System.Globalization.CultureInfo.CurrentCulture, System.SR.EventSource_IllegalKeywordsValue, System.SR.EventSource_KeywordCollision, System.SR.EventSource_KeywordNeedPowerOfTwo, System.Diagnostics.Tracing.ManifestBuilder.flags, System.SR.Format(), System.Diagnostics.Tracing.ManifestBuilder.keywordTab, System.L, System.Diagnostics.Tracing.ManifestBuilder.ManifestError(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.