/// <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); } }
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()); }
/// <summary> /// Standardize form error messages. /// </summary> public static string FormatMessage(this ExecutionMessageCollection messagesList, bool concatOneLine = false) { return(AppExtensions.FormatMessage(messagesList, string.Empty, concatOneLine)); }
public static IEnumerable <WebMessage> WebMessages(this ExecutionMessageCollection msgs) { return(msgs.ToArray().WebMessages()); }
public static string StringifyMessages(this ExecutionMessageCollection msgs) { return(msgs.ToArray().StringifyMessages()); }
/// <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); }
public ExecutionMessageCollectionEventArgs(ExecutionMessageCollection messages) { _messages = messages; }