public static MvcHtmlString Pagination(this HtmlHelper html)
        {
            var pageable = html.ViewData.Model as IPageableInfo;
            if (pageable == null) throw new AwesomeException("your view is not strongly typed to IPageable<>, make it strongly typed to IPageable<> or specify all the parameters");

            var pageCount = pageable.PageCount;
            var pageIndex = pageable.PageIndex;
            return Pagination(html, pageCount, pageIndex, html.Controller(), html.Action());
        }
Esempio n. 2
0
 public static bool IsCurrentController(this HttpRequestBase request, string controller)
 {
     return request.Controller() == controller.ToLower();
 }
Esempio n. 3
0
 /// <summary>
 /// Stops the animation if any is attached to the entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public static void StopAnimation(this IEntity entity)
 {
     var controller = entity.Controller<AnimationController>();
     if (controller != null)
     {
         controller.Stop();
     }
 }
Esempio n. 4
0
        public static string ToSourceString(this RouteData routeData)
        {
            if (routeData == null)
            {
                return "(null)";
            }

            string source = routeData.Controller() + " -> " + routeData.Action();
            if (!string.IsNullOrEmpty(routeData.Area()))
            {
                source = routeData.Area() + " Area -> " + source;
            }
            return source;
        }