Esempio n. 1
0
 private string GetChannelName(EventChannel channel, string eventName, string eventMessage)
 {
     ManifestBuilder.ChannelInfo channelInfo = (ManifestBuilder.ChannelInfo)null;
     if (this.channelTab == null || !this.channelTab.TryGetValue((int)channel, out channelInfo))
     {
         if (channel < EventChannel.Admin)
         {
             this.ManifestError(Environment.GetResourceString("EventSource_UndefinedChannel", (object)channel, (object)eventName), false);
         }
         if (this.channelTab == null)
         {
             this.channelTab = new Dictionary <int, ManifestBuilder.ChannelInfo>(4);
         }
         string name = channel.ToString();
         if (EventChannel.Debug < channel)
         {
             name = "Channel" + name;
         }
         this.AddChannel(name, (int)channel, this.GetDefaultChannelAttribute(channel));
         if (!this.channelTab.TryGetValue((int)channel, out channelInfo))
         {
             this.ManifestError(Environment.GetResourceString("EventSource_UndefinedChannel", (object)channel, (object)eventName), false);
         }
     }
     if (this.resources != null && eventMessage == null)
     {
         eventMessage = this.resources.GetString("event_" + eventName, CultureInfo.InvariantCulture);
     }
     if (channelInfo.Attribs.EventChannelType == EventChannelType.Admin && eventMessage == null)
     {
         this.ManifestError(Environment.GetResourceString("EventSource_EventWithAdminChannelMustHaveMessage", (object)eventName, (object)channelInfo.Name), false);
     }
     return(channelInfo.Name);
 }
Esempio n. 2
0
        /// <summary>
        /// Returns a string representation of an EventChannel.
        /// </summary>
        /// <param name="channel">The channel to get a name for.</param>
        /// <returns>Name of the channel (or a numeric string, if standard name is not known).</returns>
        /// <remarks>Enum.GetName() could be used but it is using reflection and because of that it is an order of magnitude less efficient.</remarks>
        private static string GetChannelName(this EventChannel channel)
        {
            switch (channel)
            {
            case EventChannel.None: return(nameof(EventChannel.None));

            case EventChannel.Admin: return(nameof(EventChannel.Admin));

            case EventChannel.Operational: return(nameof(EventChannel.Operational));

            case EventChannel.Analytic: return(nameof(EventChannel.Analytic));

            case EventChannel.Debug: return(nameof(EventChannel.Debug));

            default: return(channel.ToString());
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Create an Invitation-Log-Event to capture a unique stage in an Invitation's Journey
 /// </summary>
 /// <param name="eventAction"></param>
 /// <param name="eventChannel"></param>
 /// <param name="queueData"></param>
 /// <param name="logMessage"></param>
 /// <returns></returns>
 public static InvitationLogEvent CreateInvitationLogEvent(EventAction eventAction, EventChannel eventChannel, QueueData queueData, LogMessage logMessage)
 {
     return(new InvitationLogEvent
     {
         Action = eventAction,
         Channel = eventChannel,
         EventStatus = null,
         LogMessage = logMessage,
         Message = $"Message Template Id: {queueData?.TemplateId} | Additional Token Parameters: {queueData.AdditionalURLParameter}",
         TargetId = eventChannel == EventChannel.Email ? queueData?.EmailId :
                    eventChannel == EventChannel.SMS ? queueData?.MobileNumber : eventChannel.ToString(),
         TimeStamp = DateTime.UtcNow
     });
 }
 // Update is called once per frame
 void Update()
 {
     _textChannel.ToString();
     text.text = currentString;
 }