public static string Concatenate([NotNull] NotificationCollection notifications, [CanBeNull] string separator, [CanBeNull] string format = null) { Assert.ArgumentNotNull(notifications, nameof(notifications)); var sb = new StringBuilder(); foreach (INotification notification in notifications) { string message = string.IsNullOrEmpty(format) ? notification.Message : string.Format(format, notification.Message); if (sb.Length == 0) { sb.Append(message); } else { sb.AppendFormat("{0}{1}", separator, message); } } return(sb.ToString()); }
public static void Add([CanBeNull] NotificationCollection notifications, [NotNull] string format, params object[] args) { notifications?.Add(format, args); }
public static void Add([CanBeNull] NotificationCollection notifications, [NotNull] string message) { notifications?.Add(message); }