Esempio n. 1
0
 /// <summary>
 /// Adds a collection of <see cref="ExecutionMessage">ExecutionMessages</see> to the end of the collection.
 /// </summary>
 /// <param name="newMessages">Collection of <see cref="ExecutionMessage">ExecutionMessages</see>.</param>
 public void AddRange(ExecutionMessageCollection newMessages)
 {
     foreach (ExecutionMessage em in newMessages)
     {
         this.Add(em);
     }
 }
Esempio n. 2
0
        public static string FormatMessage(this ExecutionMessageCollection messagesList, string routineName, bool concatOneLine = false)
        {
            if (messagesList.Count == 0)
            {
                return(string.Empty);
            }

            var Msgs = new List <string>();

            if (!routineName.IsEmpty())
            {
                Msgs.Add(routineName.Trim());
            }

            // Loop thru Messages
            var Str = new StringBuilder();

            foreach (ExecutionMessage Msg in messagesList)
            {
                string s = Msg.Text.Replace("PLEASE NOTE: ", "");
                if (!Msgs.Contains(s, StringComparison.CurrentCultureIgnoreCase))
                {
                    Msgs.Add(s);
                    if (concatOneLine)
                    {
                        Str.Append(string.Format("{0}{1}", Str.Length == 0 ? "" : " | ", s));
                    }
                    else
                    {
                        Str.AppendLine(s);
                    }
                }
            }

            return(Str.ToString());
        }
Esempio n. 3
0
 /// <summary>
 /// Standardize form error messages.
 /// </summary>
 public static string FormatMessage(this ExecutionMessageCollection messagesList, bool concatOneLine = false)
 {
     return(AppExtensions.FormatMessage(messagesList, string.Empty, concatOneLine));
 }
Esempio n. 4
0
 public static IEnumerable <WebMessage> WebMessages(this ExecutionMessageCollection msgs)
 {
     return(msgs.ToArray().WebMessages());
 }
Esempio n. 5
0
 public static string StringifyMessages(this ExecutionMessageCollection msgs)
 {
     return(msgs.ToArray().StringifyMessages());
 }
Esempio n. 6
0
 /// <summary>
 /// Construct class and add a list of messages.
 /// </summary>
 /// <param name="messages">ExecutionMessageCollection to add to this list.</param>
 public ExecutionMessageCollection(ExecutionMessageCollection messages)
 {
     this.AddRange(messages);
 }
Esempio n. 7
0
 public ExecutionMessageCollectionEventArgs(ExecutionMessageCollection messages)
 {
     _messages = messages;
 }