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

◆ GetChannelName()

string System.Diagnostics.Tracing.ManifestBuilder.GetChannelName ( EventChannel channel,
string eventName,
string eventMessage )
inlineprivate

Definition at line 631 of file ManifestBuilder.cs.

632 {
633 if (channelTab == null || !channelTab.TryGetValue((int)channel, out var value))
634 {
635 if ((int)channel < 16)
636 {
637 ManifestError(SR.Format(SR.EventSource_UndefinedChannel, channel, eventName));
638 }
639 if (channelTab == null)
640 {
642 }
643 string text = channel.ToString();
644 if (19 < (int)channel)
645 {
646 text = "Channel" + text;
647 }
648 AddChannel(text, (int)channel, GetDefaultChannelAttribute(channel));
649 if (!channelTab.TryGetValue((int)channel, out value))
650 {
651 ManifestError(SR.Format(SR.EventSource_UndefinedChannel, channel, eventName));
652 }
653 }
654 if (resources != null && eventMessage == null)
655 {
657 }
658 if (value.Attribs.EventChannelType == EventChannelType.Admin && eventMessage == null)
659 {
660 ManifestError(SR.Format(SR.EventSource_EventWithAdminChannelMustHaveMessage, eventName, value.Name));
661 }
662 return value.Name;
663 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static EventChannelAttribute GetDefaultChannelAttribute(EventChannel channel)
void ManifestError(string msg, bool runtimeCritical=false)
void AddChannel(string name, int value, EventChannelAttribute channelAttribute)
Dictionary< int, ChannelInfo > channelTab
static CultureInfo InvariantCulture
virtual ? string GetString(string name)

References System.Diagnostics.Tracing.ManifestBuilder.AddChannel(), System.Diagnostics.Tracing.ManifestBuilder.channelTab, System.Diagnostics.Tracing.ManifestBuilder.eventName, System.SR.EventSource_EventWithAdminChannelMustHaveMessage, System.SR.EventSource_UndefinedChannel, System.SR.Format(), System.Diagnostics.Tracing.ManifestBuilder.GetDefaultChannelAttribute(), System.Resources.ResourceManager.GetString(), System.Globalization.CultureInfo.InvariantCulture, System.Diagnostics.Tracing.ManifestBuilder.ManifestError(), System.Diagnostics.Tracing.ManifestBuilder.resources, System.text, System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Diagnostics.Tracing.ManifestBuilder.StartEvent().