예제 #1
0
        /// <summary>
        ///     Creates a list of terms with their associated descriptions.
        /// </summary>
        /// <param name="isHorizontal">
        ///     Make terms and descriptions in the description list line up side-by-side.
        /// </param>
        public BootstrapMvcList BeginDescriptionList(bool isHorizontal)
        {
            var list = new BootstrapMvcList(Html.ViewContext);

            list.BeginDescriptionList(isHorizontal);

            return(list);
        }
예제 #2
0
        /// <summary>
        ///     Begins a new list tag
        /// </summary>
        /// <param name="listType">Type of the desired list.</param>
        /// <returns>
        /// </returns>
        public BootstrapMvcList BeginList(ListType listType)
        {
            var list = new BootstrapMvcList(Html.ViewContext);

            list.BeginList(listType);

            return(list);
        }
예제 #3
0
        /// <summary>
        ///     Creates a list with the associated elements.
        /// </summary>
        /// <param name="listType">The type of the list.</param>
        /// <param name="elements">The elements of the list.</param>
        public MvcHtmlString List(ListType listType, IEnumerable <string> elements)
        {
            if (elements == null)
            {
                return(null);
            }

            var root = BootstrapMvcList.GetRootTagBuilder(listType);

            foreach (var element in elements)
            {
                root.CreateChildTag("li", element);
            }

            return(root.ToMvcHtmlString());
        }