iSchedulerReportAreaRegistration.cs 1.35 KB
using System;
using System.Web.Mvc;
using Vrh.iScheduler.Report;

namespace Vrh.Web.iScheduler.Report.Areas.iSchedulerReport
{
    /// <summary>
    /// A webes Area regisztárciójához szükséges osztály
    /// </summary>
    public class iSchedulerReportAreaRegistration : AreaRegistration
    {
        /// <summary>
        /// Visszaadja a modul area nevét.
        /// </summary>
        public override string AreaName 
        {
            get 
            {
                return SRConstants.AREA;
            }
        }

        /// <summary>
        /// Area regisztrációhoz szükséges metódus.
        /// </summary>
        /// <param name="context"></param>
        public override void RegisterArea(AreaRegistrationContext context) 
        {
            RegisterRoutes(context);

            //nyelvi fordítások inicializálása
            VRH.Log4Pro.MultiLanguageManager.MultiLanguageManager.InitializeWordCodes(typeof(SRWordCodes));
        }

        private void RegisterRoutes(AreaRegistrationContext context)
        {
            if (context == null) { throw new ArgumentNullException("context"); }

            context.MapRoute(
                this.AreaName + "_default",
                this.AreaName + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}