using Rabbit.Kernel.Localization;
using Rabbit.Web.UI.Navigation;

namespace Rabbit.Module1
{
    internal sealed class AdminMenu : INavigationProvider
    {
        public AdminMenu()
        {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        #region Implementation of INavigationProvider

        /// <summary>
        /// »ñÈ¡µ¼º½¡£
        /// </summary>
        /// <param name="builder">µ¼º½½¨ÔìÕß¡£</param>
        public void GetNavigation(NavigationBuilder builder)
        {
            const string area = "Rabbit.Module1";
            builder.Add(T("Ä£¿é1"),
                menu =>
                    menu
                        .Position("1.2")
                        .LocalNavigation()
                        .Add(T("Module1"), i => i.Action("Index", "Admin", new { Area = area }).LocalNavigation())
                );
        }

        /// <summary>
        /// µ¼º½²Ëµ¥Ãû³Æ¡£
        /// </summary>
        public string MenuName { get { return "admin"; } }

        #endregion Implementation of INavigationProvider
    }
}