public MenuItemModel(string text, UrlModel url, string onClick) : this() { Text = text; Url = url; OnClick = onClick; }
public MenuItemModel() { Text = string.Empty; Url = new UrlModel { ActionName = string.Empty, ControllerName = string.Empty }; OnClick = string.Empty; }
public bool Equals(UrlModel urlModel) { if (urlModel == null) { return false; } return (((string.IsNullOrEmpty(AreaName) && string.IsNullOrEmpty(urlModel.AreaName)) || (string.Equals(AreaName, urlModel.AreaName, StringComparison.InvariantCultureIgnoreCase))) && ((string.IsNullOrEmpty(ControllerName)) || (ControllerName.Equals(urlModel.ControllerName, StringComparison.InvariantCultureIgnoreCase)) && ((ActionName == null) || ActionName.Equals(urlModel.ActionName, StringComparison.InvariantCultureIgnoreCase)))); }
public bool Equals(UrlModel urlModel) { if (urlModel == null) { return(false); } return(((string.IsNullOrEmpty(AreaName) && string.IsNullOrEmpty(urlModel.AreaName)) || (string.Equals(AreaName, urlModel.AreaName, StringComparison.InvariantCultureIgnoreCase))) && ((string.IsNullOrEmpty(ControllerName)) || (ControllerName.Equals(urlModel.ControllerName, StringComparison.InvariantCultureIgnoreCase)) && ((ActionName == null) || ActionName.Equals(urlModel.ActionName, StringComparison.InvariantCultureIgnoreCase)))); }
public PartialViewResult Menu(UrlModel selectedUrl) { var model = new MenuModel { Items = new List<MenuItemModel> { new MenuItemModel { Text = "Home", Url = new UrlModel { ActionName = "Index", ControllerName = "Home" }}, new MenuItemModel { Text = "About", Url = new UrlModel { ActionName = "Index", ControllerName = "About" }}, new MenuItemModel { Text = "Why study music", Url = new UrlModel { ActionName = "Index", ControllerName = "Music" }}, //new MenuItemModel { Text = "Voice", Url = new UrlModel { ActionName = "Index", ControllerName = "Voice" }}, new MenuItemModel { Text = "Gallery", Url = new UrlModel { ActionName = "Index", ControllerName = "Gallery" }}, new MenuItemModel { Text = "Testimonials", Url = new UrlModel { ActionName = "Index", ControllerName = "Testimonials" }}, new MenuItemModel { Text = "Contacts", Url = new UrlModel { ActionName = "Index", ControllerName = "Contacts" }} }, SelectedItem = selectedUrl }; return PartialView(model); }
public static bool IsCurrentRoute(this RequestContext context, UrlModel url) { var requestUrl = context.RouteData.GetCurrentUrl(); return url.Equals(requestUrl); }
public static bool IsCurrentRoute(this RequestContext context, string areaName, string controllerName, string actionName) { var url = new UrlModel { ActionName = actionName, ControllerName = controllerName, AreaName = areaName }; return context.IsCurrentRoute(url); }
public MenuItemModel(string text, UrlModel url) : this() { Text = text; Url = url; }