OneReportAreaRegistration.cs 1.69 KB
using System;
using System.Web.Mvc;
using Vrh.OneReport;

namespace Vrh.Web.OneReport.Areas.OneReport
{
    /// <summary>
    /// OneReport area regisztrálásához való osztály.
    /// </summary>
    public class OneReportAreaRegistration : AreaRegistration 
    {
        /// <summary>
        /// Az area neve.
        /// </summary>
        public override string AreaName 
        {
            get 
            {
                return Constants.AREA_NAME;
            }
        }

        /// <summary>
        /// A regisztrációkor meghívott metódus.
        /// </summary>
        /// <param name="context"></param>
        public override void RegisterArea(AreaRegistrationContext context) 
        {
            RegisterRoutes(context);
            //RegisterBundles(BundleTable.Bundles);
        }

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

            context.MapRoute(
                string.Concat(Constants.AREA_NAME, "_default"),
                string.Concat(Constants.AREA_NAME, "/{controller}/{action}/{id}"),
                new { action = "Index", id = UrlParameter.Optional }
            );
        }

        //private void RegisterBundles(BundleCollection bundles)
        //{
        //    if (bundles == null) { throw new ArgumentNullException("bundles"); }

        //    #region Scripts (JS)

        //    /*** Base: Az alkalmazás általános JS (javascript) összetevői ***/
        //    bundles.Add(new ScriptBundle(Constants.BUNDLE_NAME)
        //           .Include("~/Scripts/jquery-{version}.slim.min.js"));

        //    #endregion Scripts (JS)
        //}
    }
}