Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Content" /> class.
        /// </summary>
        /// <remarks>
        /// Should only use when the <see cref="Type" /> is <see cref="ContentType.AreaLink" />.
        /// </remarks>
        /// <param name="action">The controller action.</param>
        /// <param name="controller">The controller (defaults to controller in current context).</param>
        /// <param name="area">The area (defaults to area in current context).</param>
        /// <param name="areaLinkIcon">The type of area link icon to use in the link.</param>
        /// <param name="type">The content type of text.</param>
        /// <param name="text">The text data.</param>
        /// <param name="routeValues">The route values to include in a link.</param>
        /// <param name="routeName">The name of the route to use when generating the link.</param>
        public Content(ContentType type, string text, string action, string controller, string area, AreaLinkIconType areaLinkIcon, IDictionary <string, object> routeValues, string routeName)
        {
            Type         = type;
            Text         = text;
            Action       = action;
            Controller   = controller;
            Area         = area;
            AreaLinkIcon = areaLinkIcon;

            if (routeValues != null)
            {
                routeValues.Remove("area");
            }

            RouteValues = routeValues;
            RouteName   = routeName;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a <see cref="ContentType.AreaLink" /> which renders as a specialised anchor tag in the HTML output.
        /// </summary>
        /// <remarks>
        /// Should only be used on Area landing pages.
        /// </remarks>
        /// <param name="areaLinkIcon">The type of area link icon to use in the link.</param>
        /// <param name="action">The controller action.</param>
        /// <param name="controller">The controller (defaults to controller in current context).</param>
        /// <param name="area">The area (defaults to area in current context).</param>
        /// <param name="text">The text to display in the link.</param>
        /// <param name="routeValues">The route values to include in a link.</param>
        /// <param name="routeName">The name of the route to use when generating the link.</param>
        /// <returns>The current instance of <see cref="ContentViewModel" />.</returns>
        public ContentViewModel AddAreaLink(AreaLinkIconType areaLinkIcon, string action, string controller, string area, string text, IDictionary <string, object> routeValues, string routeName)
        {
            content.Add(new Content(ContentType.AreaLink, text, action, controller, area, areaLinkIcon, routeValues, routeName));

            return(this);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Add a <see cref="ContentType.AreaLink" /> which renders as a specialised anchor tag in the HTML output.
 /// </summary>
 /// <remarks>
 /// Should only be used on Area landing pages.
 /// </remarks>
 /// <param name="areaLinkIcon">The type of area link icon to use in the link.</param>
 /// <param name="action">The controller action.</param>
 /// <param name="controller">The controller (defaults to controller in current context).</param>
 /// <param name="area">The area (defaults to area in current context).</param>
 /// <param name="text">The text to display in the link.</param>
 /// <param name="routeValues">The route values to include in a link.</param>
 /// <returns>The current instance of <see cref="ContentViewModel" />.</returns>
 public ContentViewModel AddAreaLink(AreaLinkIconType areaLinkIcon, string action, string controller, string area, string text, IDictionary <string, object> routeValues)
 {
     return(AddAreaLink(areaLinkIcon, action, controller, area, text, routeValues, null));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Add a <see cref="ContentType.AreaLink" /> which renders as a specialised anchor tag in the HTML output.
 /// </summary>
 /// <remarks>
 /// Should only be used on Area landing pages.
 /// </remarks>
 /// <param name="areaLinkIcon">The type of area link icon to use in the link.</param>
 /// <param name="action">The controller action.</param>
 /// <param name="controller">The controller (defaults to controller in current context).</param>
 /// <param name="area">The area (defaults to area in current context).</param>
 /// <param name="text">The text to display in the link.</param>
 /// <returns>The current instance of <see cref="ContentViewModel" />.</returns>
 public ContentViewModel AddAreaLink(AreaLinkIconType areaLinkIcon, string action, string controller, string area, string text)
 {
     return(AddAreaLink(areaLinkIcon, action, controller, area, text, null, null));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Add a <see cref="ContentType.AreaLink" /> which renders as a specialised anchor tag in the HTML output.
 /// </summary>
 /// <remarks>
 /// Should only be used on Area landing pages.
 /// </remarks>
 /// <param name="areaLinkIcon">The type of area link icon to use in the link.</param>
 /// <param name="action">The controller action.</param>
 /// <param name="text">The text to display in the link.</param>
 /// <param name="routeValues">The route values to include in a link.</param>
 /// <param name="routeName">The name of the route to use when generating the link.</param>
 /// <returns>The current instance of <see cref="ContentViewModel" />.</returns>
 public ContentViewModel AddAreaLink(AreaLinkIconType areaLinkIcon, string action, string text, IDictionary <string, object> routeValues, string routeName)
 {
     return(AddAreaLink(areaLinkIcon, action, null, null, text, routeValues, routeName));
 }