/// <summary>
		///     Convert <see cref="OperationMessageLevel" /> to a CSS class names.
		/// </summary>
		/// <param name="value">The value to converting.</param>
		/// <param name="listStyle">The list style of the operation message list.</param>
		/// <returns>Converted class names. Using space to split mutilple class names.</returns>
		public string MapLevel(OperationMessageLevel value, MessageListStyle listStyle)
		{
			switch (listStyle)
			{
				case MessageListStyle.AlertDialog:
				case MessageListStyle.AlertDialogClosable:
					return MapLevelForAlert(value);
				case MessageListStyle.List:
					return MapLevelForListItem(value);
				default:
					throw new ArgumentException("The argument value is not a valid enum item.", nameof(listStyle));
			}
		}
        /// <summary>
        ///     Convert <see cref="OperationMessageLevel" /> to a CSS class names.
        /// </summary>
        /// <param name="value">The value to converting.</param>
        /// <param name="listStyle">The list style of the operation message list.</param>
        /// <returns>Converted class names. Using space to split mutilple class names.</returns>
        public string MapLevel(OperationMessageLevel value, MessageListStyle listStyle)
        {
            switch (listStyle)
            {
            case MessageListStyle.AlertDialog:
            case MessageListStyle.AlertDialogClosable:
                return(MapLevelForAlert(value));

            case MessageListStyle.List:
                return(MapLevelForListItem(value));

            default:
                throw new ArgumentException("The argument value is not a valid enum item.", nameof(listStyle));
            }
        }
		/// <summary>
		///     Generate the HTML message list for a collection of <see cref="OperationMessage" /> items.
		/// </summary>
		/// <param name="messages">The collection of all <see cref="OperationMessage" /> items.</param>
		/// <param name="listStyle">The list style of the <see cref="OperationMessage" />.</param>
		/// <param name="useTwoLineMode">If the two line mode should be used.</param>
		/// <returns>The generated HTML message list for all messages.</returns>
		public IHtmlContent GenerateList(IEnumerable<OperationMessage> messages, MessageListStyle listStyle,
			bool useTwoLineMode)
		{
			if (messages == null)
			{
				throw new ArgumentNullException(nameof(messages));
			}

			switch (listStyle)
			{
				case MessageListStyle.AlertDialog:
				case MessageListStyle.AlertDialogClosable:
					return GenerateAlertList(messages, listStyle, useTwoLineMode);
				case MessageListStyle.List:
					return GenerateNormalList(messages, useTwoLineMode);
				default:
					throw new ArgumentException("The value of the argument is not a valid enum item.", nameof(listStyle));
			}
		}
        /// <summary>
        ///     Generate the HTML message list for a collection of <see cref="OperationMessage" /> items.
        /// </summary>
        /// <param name="messages">The collection of all <see cref="OperationMessage" /> items.</param>
        /// <param name="listStyle">The list style of the <see cref="OperationMessage" />.</param>
        /// <param name="useTwoLineMode">If the two line mode should be used.</param>
        /// <returns>The generated HTML message list for all messages.</returns>
        public IHtmlContent GenerateList(IEnumerable <OperationMessage> messages, MessageListStyle listStyle,
                                         bool useTwoLineMode)
        {
            if (messages == null)
            {
                throw new ArgumentNullException(nameof(messages));
            }

            switch (listStyle)
            {
            case MessageListStyle.AlertDialog:
            case MessageListStyle.AlertDialogClosable:
                return(GenerateAlertList(messages, listStyle, useTwoLineMode));

            case MessageListStyle.List:
                return(GenerateNormalList(messages, useTwoLineMode));

            default:
                throw new ArgumentException("The value of the argument is not a valid enum item.", nameof(listStyle));
            }
        }
        /// <summary>
        ///     Generate the a series of alert dialogs for a collection of <see cref="OperationMessage" /> items.
        /// </summary>
        /// <param name="messages">The collection of all <see cref="OperationMessage" /> items.</param>
        /// <param name="listStyle">The list style of the <see cref="OperationMessage" />.</param>
        /// <param name="useTwoLineMode">If the two line mode should be used.</param>
        /// <returns>The generated HTML content which represent as a series of alert dialogs.</returns>
        private IHtmlContent GenerateAlertList(IEnumerable <OperationMessage> messages, MessageListStyle listStyle,
                                               bool useTwoLineMode)
        {
            var tag = new TagBuilder("div");

            var content = new DefaultTagHelperContent();

            foreach (var message in messages)
            {
                content.AppendHtml(GenerateAlertItem(message, listStyle == MessageListStyle.AlertDialogClosable,
                                                     useTwoLineMode));
            }

            tag.InnerHtml.AppendHtml(content);

            return(tag);
        }
		/// <summary>
		///     Generate the a series of alert dialogs for a collection of <see cref="OperationMessage" /> items.
		/// </summary>
		/// <param name="messages">The collection of all <see cref="OperationMessage" /> items.</param>
		/// <param name="listStyle">The list style of the <see cref="OperationMessage" />.</param>
		/// <param name="useTwoLineMode">If the two line mode should be used.</param>
		/// <returns>The generated HTML content which represent as a series of alert dialogs.</returns>
		private IHtmlContent GenerateAlertList(IEnumerable<OperationMessage> messages, MessageListStyle listStyle,
			bool useTwoLineMode)
		{
			var tag = new TagBuilder("div");

			var content = new DefaultTagHelperContent();

			foreach (var message in messages)
			{
				content.AppendHtml(GenerateAlertItem(message, listStyle == MessageListStyle.AlertDialogClosable,
					useTwoLineMode));
			}

			tag.InnerHtml.AppendHtml(content);

			return tag;
		}