public string Url(INavigatable navigatable, Action<RouteValueDictionary> configurator) { RouteValueDictionary routeValues = PrepareRouteValues(navigatable.RouteValues); configurator(routeValues); return navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues); }
public static bool IsCurrent(this INavigatable navigatable, ViewContext viewContext) { string pathAndQuery = viewContext.HttpContext.Request.Url.PathAndQuery; string url = navigatable.GenerateUrl(viewContext.RequestContext); string comparing = new UrlHelper(viewContext.RequestContext).RouteUrl(viewContext.RequestContext.RouteData.Values); return(url.IsCaseInsensitiveEqual(pathAndQuery) || url.IsCaseInsensitiveEqual(comparing)); }
public static string GenerateUrl(this INavigatable navigatable, ActionContext actionContext) { Guard.NotNull(actionContext, nameof(actionContext)); return(navigatable.GenerateUrl( actionContext.HttpContext.GetServiceScope().Resolve <IUrlHelper>(), actionContext.RouteData.Values)); }
public string Url(INavigatable navigatable, Action <RouteValueDictionary> configurator) { RouteValueDictionary routeValues = PrepareRouteValues(navigatable.RouteValues); configurator(routeValues); return(navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues)); }
public string Url(INavigatable navigatable, string key, object value) { RouteValueDictionary routeValues = PrepareRouteValues(navigatable.RouteValues); routeValues[grid.Prefix(key)] = value; return(navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues)); }
public string Url(INavigatable navigatable, bool copy) { var routeValues = new RouteValueDictionary(navigatable.RouteValues); if (copy) { routeValues = PrepareRouteValues(navigatable.RouteValues); } return(navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues)); }
public static bool IsCurrent(this INavigatable navigatable, ControllerContext controllerContext) { var url = navigatable.GenerateUrl(controllerContext.RequestContext)?.ToLower(); if (url.IsEmpty()) { return(false); } var compare = GetCurrentPathInfo(controllerContext); if (url == compare.RequestPath || url == compare.RoutePath) { return(true); } return(false); }
public static bool IsCurrent(this INavigatable navigatable, ActionContext actionContext) { // TODO: (mh) (core) Test this thoroughly! var url = navigatable.GenerateUrl(actionContext)?.ToLower(); if (url.IsEmpty()) { return(false); } var compare = GetCurrentPathInfo(actionContext); if (url == compare.RequestPath || url == compare.RoutePath) { return(true); } return(false); }
private void SetUrl(INavigatable operation) { operation.Url = operation.GenerateUrl(viewContext, urlGenerator); }
public string Url(INavigatable navigatable, bool copy) { var routeValues = new RouteValueDictionary(navigatable.RouteValues); if (copy) { routeValues = PrepareRouteValues(navigatable.RouteValues); } return navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues); }
private Uri GenerateUrl(INavigatable navigatable) { var routeValues = PrepareRouteData(navigatable.RouteValues); return navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues); }
public string PrepareUrl(INavigatable navigatable) { return(navigatable.GenerateUrl(viewContext, urlGenerator)); }
public string PrepareUrl(INavigatable navigatable) { return navigatable.GenerateUrl(viewContext, urlGenerator); }
public static string GenerateUrl(this INavigatable navigatable, RequestContext requestContext, RouteValueDictionary routeValues = null) { return(navigatable.GenerateUrl(new UrlHelper(requestContext), routeValues)); }
public string Url(INavigatable navigatable, string key, object value) { RouteValueDictionary routeValues = PrepareRouteValues(navigatable.RouteValues); routeValues[grid.Prefix(key)] = value; return navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues); }
public static string GenerateUrl(this INavigatable navigatable, ActionContext actionContext) { var urlHelper = actionContext.HttpContext.GetServiceScope().Resolve <IUrlHelperFactory>().GetUrlHelper(actionContext); return(navigatable.GenerateUrl(urlHelper, actionContext.RouteData.Values)); }