Exemplo n.º 1
0
 public MenuItemModel(string text, UrlModel url, string onClick)
     : this()
 {
     Text    = text;
     Url     = url;
     OnClick = onClick;
 }
Exemplo n.º 2
0
 public MenuItemModel(string text, UrlModel url, string onClick)
     : this()
 {
     Text = text;
     Url = url;
     OnClick = onClick;
 }
Exemplo n.º 3
0
 public MenuItemModel()
 {
     Text = string.Empty;
     Url  = new UrlModel {
         ActionName = string.Empty, ControllerName = string.Empty
     };
     OnClick = string.Empty;
 }
Exemplo n.º 4
0
        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))));
        }
Exemplo n.º 5
0
        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))));
        }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 public static bool IsCurrentRoute(this RequestContext context, UrlModel url)
 {
     var requestUrl = context.RouteData.GetCurrentUrl();
     return url.Equals(requestUrl);
 }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
 public MenuItemModel(string text, UrlModel url)
     : this()
 {
     Text = text;
     Url  = url;
 }
Exemplo n.º 10
0
 public MenuItemModel()
 {
     Text = string.Empty;
     Url = new UrlModel { ActionName = string.Empty, ControllerName = string.Empty };
     OnClick = string.Empty;
 }
Exemplo n.º 11
0
 public MenuItemModel(string text, UrlModel url)
     : this()
 {
     Text = text;
     Url = url;
 }