Exemplo n.º 1
0
        public NavigationLink(ControllerContext context,
            string controllerName, string actionName, string title)
        {
            var logger = ObjectFactory.GetInstance<Logger>();

            if (context == null)
            {
                logger.Error("[ViewModels].[Management].[NavigationLink()] throwing exception ([context] == null).");
                throw new ArgumentNullException("context");
            }

            if (title == null)
            {
                logger.Error("[ViewModels].[Management].[NavigationLink()] throwing exception ([title] == null).");
                throw new ArgumentNullException("title");
            }

            IsEnabled = context.GetControllerName() != controllerName;
            Url = context.ResolveUrl(controllerName, actionName);
            Title = title;
        }