Ejemplo n.º 1
5
 public override void RegisterArea(AreaRegistrationContext context)
 {
     //index
     context.MapRoute(
         "AdminArea_Index",
         "adminarea/index.html",
         new
         {
             action = "index",
             controller = "home"
         },
         new[] { "Icode.Blog.Web.Areas.AdminArea.Controllers" }
     );
     //默认路由
     context.MapRoute(
         "AdminArea_default",
         "adminarea/{controller}_{action}.html",
         new
         {
             action = "index",
             controller = "home"
         },
         new[] { "Icode.Blog.Web.Areas.AdminArea.Controllers" }
     );
 }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            bus.Send(new RegisterAreaMessage("Link to the Demo area", AreaName, DefaultController, DefaultAction));

            RegisterRoutes(context);
            RegisterAreaEmbeddedResources();
        }
Ejemplo n.º 3
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute("", "shopping", new { area = "Shop", controller = "Shop", action = "Shopping" });
     context.MapRoute("", "products", new { area = "Shop", controller = "Shop", action = "Products" });
     context.MapRoute("", "products/{id}", new { area = "Shop", controller = "Shop", action = "Product" });
     context.MapRoute("", "search", new { area = "Shop", controller = "Shop", action = "Search" });
 }
Ejemplo n.º 4
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         "Admin_default",
         "Admin/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional } );
 }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            #region == Blog ==
            context.MapRoute(
                "Accounts_Blog_default",
                "Accounts/Blog/{action}",
                new { action = "Index", controller = "Blog" }
            );
            #endregion


            #region == Company ==
            context.MapRoute(
                "Accounts_Company_default",
                "Accounts/Company/{action}",
                new { action = "NewsList", controller = "Company" }
            );
            #endregion



            context.MapRoute(
                "Accounts_default",
                "Accounts/{action}",
                new { action = "Index",controller="Accounts" }
            );
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            var routeContraint = new UserRouteConstraint(DependencyResolver.Current.GetService<IUserRepository>());

            context.MapRoute(
            "Users_albums",
            "{username}/albums/{id}/{name}",
            new { controller = "albums", action = "name", id="id"},
            constraints: new
            {
                username = routeContraint,
            });

            context.MapRoute(
            "Users_date",
            "{username}/{year}/{month}/{day}",
            new { controller = "date", action = "Index", month = UrlParameter.Optional, day = UrlParameter.Optional },
            constraints: new
                {
                    username = routeContraint,
                    year = @"\d{4}"
                });

            context.MapRoute(
            "Users_media",
            "{username}/media/{id}",
            new { controller = "Media", action = "Index" },
            constraints: new { username = routeContraint });

            context.MapRoute(
                "Users_default",
                "{username}/{controller}/{action}/{id}",
                new {  controller = "index", action = "Index", id = UrlParameter.Optional },
                constraints: new { username = routeContraint });
        }
Ejemplo n.º 7
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "AdminAlbumList",
                "Admin/Album/List",
                new { controller = "AdminAlbumController", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "AdminAlbumCreate",
                "Admin/Album/Create",
                new { controller = "AlbumController", action = "Create", id = UrlParameter.Optional }
               );

            context.MapRoute(
                "AdminAlbumEdit",
                "Admin/Album/Edit/{id}",
                new { controller = "AdminAlbumController", action = "Edit", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "AdminAlbumDelete",
                "Admin/Album/Delete/{id}",
                new { controller = "AdminAlbumController", action = "Delete" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Ejemplo n.º 8
0
        public Mocks()
        {
            ContextMock = new Mock<HttpContextBase>();
            RequestMock = new Mock<HttpRequestBase>();
            ResponseMock = new Mock<HttpResponseBase>();
            ServerMock = new Mock<HttpServerUtilityBase>();

            ContextMock.Setup(ctx => ctx.Request).Returns(Request);
            ContextMock.Setup(ctx => ctx.Response).Returns(Response);
            ContextMock.Setup(ctx => ctx.Server).Returns(Server);

            RequestMock.Setup(x => x.ApplicationPath).Returns("/");
            RequestMock.Setup(x => x.Url).Returns(new Uri("http://localhost/a", UriKind.Absolute));
            RequestMock.Setup(x => x.ServerVariables).Returns(new NameValueCollection());

            ResponseMock.Setup(x => x.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(x => x);

            var routes = new RouteCollection();
            //AreaRegistration.RegisterAllAreas();
            var areaRegistration = new AreaRegistrationContext("Admin", routes);
            new AdminAreaRegistration().RegisterArea(areaRegistration);
            RouteConfig.RegisterRoutes(routes);

            var requestContext = new RequestContext(Context, new RouteData());
            UrlHelper = new UrlHelper(requestContext, routes);
        }
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
       name: "Private_default",
         url: "Private/{controller}/{action}",
         defaults: new { controller = "HomeStorage", action = "Index" });
 }
Ejemplo n.º 10
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Publishing_default",
                "Publishing/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "Kooboo.CMS.Modules.Publishing.Web.Areas.Publishing.Controllers", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
            );


            Kooboo.Web.Mvc.Menu.MenuFactory.RegisterAreaMenu(AreaName, Path.Combine(Settings.BaseDirectory, "Areas", AreaName, "Menu.config"));
            Kooboo.Web.Mvc.WebResourceLoader.ConfigurationManager.RegisterSection(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "WebResources.config"));

            base.RegisterArea(context);

            #region RegisterPermissions

            var roleManager = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<RoleManager>();


            roleManager.AddPermission(Publishing_Local_Queue);
            roleManager.AddPermission(Publishing_Remote_RemoteSites);
            roleManager.AddPermission(Publishing_Remote_TextFolderMapping);
            roleManager.AddPermission(Publishing_Remote_Queue);
            roleManager.AddPermission(Publishing_Remote_Incoming);
            //roleManager.AddPermission(Permission.Publishing_Remote_Cmis);
            roleManager.AddPermission(Publishing_Local_Logs);
            #endregion
        }
        public AdministrationAreaRegistrationTests()
        {
            registration = new AdministrationAreaRegistration();
            context = new AreaRegistrationContext(registration.AreaName, new RouteCollection());

            registration.RegisterArea(context);
        }
Ejemplo n.º 12
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            //var metaweblogRoute = new Route("Contents/metaweblog", null, null, new MetaWeblogRouteHandler());
            //context.Routes.Add(metaweblogRoute);

            context.MapRoute(
                "Contents_default",
                "Contents/{controller}/{action}",///{repositoryName}/{name}
                new { action = "Index" }
                , null
                , new[] { "Kooboo.CMS.Web.Areas.Contents.Controllers", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
            );

            Kooboo.Web.Mvc.Menu.MenuFactory.RegisterAreaMenu(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "Menu.config"));
            Kooboo.Web.Mvc.WebResourceLoader.ConfigurationManager.RegisterSection(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "WebResources.config"));

            #region RegisterPermissions
            var roleManager = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<RoleManager>();
            roleManager.AddPermission(Permission.Contents_SettingPermission);
            roleManager.AddPermission(Permission.Contents_SchemaPermission);
            roleManager.AddPermission(Permission.Contents_FolderPermission);
            roleManager.AddPermission(Permission.Contents_ContentPermission);
            roleManager.AddPermission(Permission.Contents_BroadcastingPermission);
            roleManager.AddPermission(Permission.Contents_WorkflowPermission);
            roleManager.AddPermission(Permission.Contents_SearchSettingPermission);
            roleManager.AddPermission(Permission.Contents_HtmlBlockPermission);
            roleManager.AddPermission(Permission.Sites_Settings_CreateSubSitePermission);
            #endregion

            base.RegisterArea(context);
        }
Ejemplo n.º 13
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         "Private_default",
         "Private/{controller}/{action}/{id}",
         new { controller = "Communities", action = "Index", id = UrlParameter.Optional });
 }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                   "ForumHome",
                   "Forum/Home",
                   new { controller = "Home", action = "Index" },
                   new[] { "EstateSocialSystem.Web.Controllers" });

            context.MapRoute(
                "ForumLogOff",
                "Forum/Account/LogOff",
                new { controller = "Account", action = "LogOff" },
                new[] { "EstateSocialSystem.Web.Controllers" });

            context.MapRoute(
                "Get questions by tag",
                "questions/tagged/{tag}",
                new { controller = "Questions", action = "GetByTag" },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" });

            context.MapRoute(
                "Display question",
                "questions/{id}",
                new { controller = "Questions", action = "Display" },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" });

            context.MapRoute(
                "Forum_default",
                "Forum/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" }
            );
        }
Ejemplo n.º 15
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            RouteTable.Routes.LowercaseUrls = true;
            RouteTable.Routes.AppendTrailingSlash = true;

            //context.MapRoute(
            //    "Admin_editcategoryroute",
            //    "Admin/{controller}/{action}/{id}",
            //    new { controller = "AdminCategory", action = "Index", id = UrlParameter.Optional }
            //);
            //context.MapRoute(
            //    "Admin_edituserroute",
            //    "Admin/{controller}/{action}/{userId}",
            //    new { controller = "Admin", action = "Index", userId = UrlParameter.Optional }
            //);
            //context.MapRoute(
            //    "Admin_pagingroute",
            //    "Admin/{controller}/{action}/{page}",
            //    new { controller = "Account", action = "Index", page = UrlParameter.Optional }
            //);
            context.MapRoute(
                "Admin_defaultroute",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional }
            );
        }
 protected override void RegisterArea(
     AreaRegistrationContext context,
     IApplicationBus bus,
     PlatformAreaRegistrationState state)
 {
     this.RegisterApplicationRoutes(context);
 }
Ejemplo n.º 17
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         name: AreaName + "-Default",
         url: "admin/raven/{action}/{id}",
         defaults: new { controller = "RavenAdmin", action = "Index", id = UrlParameter.Optional });
 }
 protected void RegisterApplicationRoutes(AreaRegistrationContext context)
 {
     context.MapRoute(
         "AdminHome-Default",
         "",
         new { controller = "Admin", action = "Index" });
 }
Ejemplo n.º 19
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     Config config = Config.Load();
     context.MapSubdomainRoute(
          "Error.Http404", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "404",    // URL with parameters 
          new { controller = "Error", action = "Http404" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
     context.MapSubdomainRoute(
          "Error.Http403", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "403",    // URL with parameters 
          new { controller = "Error", action = "Http403" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
     context.MapSubdomainRoute(
          "Error.Http500", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "500",    // URL with parameters 
          new { controller = "Error", action = "Http500" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
 }
Ejemplo n.º 20
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            // TRANSLATION ROUTING 
            CultureInfo cultureEN = CultureInfo.GetCultureInfo("en-US");
            CultureInfo cultureIT = CultureInfo.GetCultureInfo("it-IT");

            DictionaryRouteValueTranslationProvider translationProvider = new DictionaryRouteValueTranslationProvider(
                new List<RouteValueTranslation> {
                    //new RouteValueTranslation(cultureIT, "Document", "preventivi-commesse-tipografia"),
                    //new RouteValueTranslation(cultureIT, "ListEstimate", "elenco-documenti-centro-stampa"),
                    //new RouteValueTranslation(cultureIT, "CreateProduct", "inserimento-di-uno-stampato"),
                    //new RouteValueTranslation(cultureIT, "Error", "errore"),
                    //new RouteValueTranslation(cultureIT, "NoTaskEstimatedOnException", "manca-definizione-costo")
                }
            );

            context.MapTranslatedRoute(
                "Working_default",
                "working-area/{controller}/{action}/{id}",
                new { controller = "Working", action = "Index", id = UrlParameter.Optional },
                new { controller = translationProvider, action = translationProvider },
                true);

            //context.MapRoute(
            //    "Working_default",
            //    "Working/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
              name: "",
              url: "Store/Search/text-{text}/page-{page}/limit-{limit}/sort-{sort}",
              defaults: new { Controller = "Store", action = "Search" },
               constraints: new { page = @"\d+", limit = @"\d+" },
              namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
              );

             context.MapRoute(
              name: "",
              url: "Store/Search/text-{text}",
              defaults: new { Controller = "Store", action = "Search" },
              namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
              );

            context.MapRoute(
                 name: "",
                 url: "Store/cat-{catId}/category-{catName}/page-{page}/limit-{limit}/sort-{sort}",
                 defaults: new { Controller = "Store", action = "Index" },
                 constraints: new { catId = @"\d+" },
                 namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
             );
            context.MapRoute(
                  name: "",
                  url: "Store/cat-{catId}/category-{catName}/page-{page}/limit-{limit}",
                  defaults: new { Controller = "Store", action = "Index" },
                  constraints: new { catId = @"\d+" },
                  namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
              );

            context.MapRoute(
                  name: "",
                  url: "Store/cat-{catId}/category-{catName}/",
                  defaults: new { Controller = "Store", action = "Index", catId = UrlParameter.Optional },
                  constraints: new { catId = @"\d+" },
                  namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
              );

            context.MapRoute(
                 name: "stone",
                 url: "Store/stoneId-{stoneId}/stone-{stone}",
                 defaults: new { Controller = "Store", action = "Index", catId = 0 },
                 namespaces: new string[] { "FashionStones.Areas.Default.Controllers" }
             );

            context.MapRoute(
                name: "default",
                url: "{controller}/{action}/{id}",
                defaults: new { Controller = "About", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "FashionStones.Areas.Default.Controllers" }
            );

            //context.MapRoute(
            //    "Default_default",
            //    "Default/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
Ejemplo n.º 22
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "AdminIdeasRoute",
                "Ideas/Admin/{action}/{id}",
                new { controller = "AdminIdeas", action = "Index", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );

            context.MapRoute(
                "IdeasRoute",
                "Ideas/{action}/{id}",
                new { controller = "SiteIdeas", action = "Index", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );

            context.MapRoute(
                "IdeasServiceRoute",
                "IdeasService/{action}/{id}",
                new { controller = "IdeasService", action = "DownloadCsv", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Registers an area in an ASP.NET MVC application using the specified area's context information.
        /// </summary>
        /// <param name="context">Encapsulates the information that is required in order to register the area.</param>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            // Map the back office route for handling pages
            context.Routes.MapUIRoute("Pages_Default",
                "ui/{controller}/{action}/{id}",
                new
                {
                    controller = "UI",
                    action = "Index",
                    id = UrlParameter.Optional,
                    area = "UI"
                },
                new[] { typeof(Controllers.UIController).Namespace });

            context.MapRoute(
                "UI_Default",
                "ui/{controller}/{action}/{id}",
                new
                {
                    controller = "UI",
                    action = "Index",
                    id = UrlParameter.Optional,
                    area = "UI"
                },
                new[] { typeof(Controllers.UIController).Namespace }
            );
        }
Ejemplo n.º 24
0
        public void CuiAreaRegistration_RegisterArea_CuiRouteAdded_DataTokensSet()
        {
            // arrange
            const string areaName = "CUI";
            const string routeName = "CUI_default";

            RouteCollection routes = new RouteCollection();
            AreaRegistrationContext context = new AreaRegistrationContext(areaName, routes); 
            var registration = new CuiAreaRegistration();
            
            // act
            registration.RegisterArea(context);

            // assert
            var route = context.Routes[routeName] as Route;
            
            Assert.IsNotNull(route);
            Assert.AreEqual("CUI/{controller}/{action}/{id}", route.Url);
            Assert.AreEqual("Main", route.Defaults["controller"]);
            Assert.AreEqual("Index", route.Defaults["action"]);
            Assert.AreEqual(areaName, route.Defaults["area"]);
            Assert.AreEqual(UrlParameter.Optional, route.Defaults["id"]);
            Assert.AreEqual("Login", route.DataTokens["LoginController"]);
            Assert.AreEqual("Index", route.DataTokens["LoginAction"]);
            Assert.AreEqual(areaName, registration.AreaName);
            Assert.AreEqual(areaName, context.AreaName);
        }
Ejemplo n.º 25
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                name: "Forums_default",
                url: "Forums",
                defaults: new
                {
                    controller = "Home",
                    action = "Index"
                },
                namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });

            context.MapRoute(name: "Topic_Default",
                url: "Forums/{forumId}",
                defaults: new
                {
                    controller = "Home",
                    action = "Topics",
                    forumId = UrlParameter.Optional
                }, namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });

            context.MapRoute(name: "Posts_default",
                url: "Forums/Posts/{topicId}",
                defaults: new
                {
                    controller = "Home",
                    action = "Posts",
                    topicId = UrlParameter.Optional
                }, namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });
        }
Ejemplo n.º 26
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     var route = context.Routes.MapHttpRoute(name: "WindowsAuthArea", routeTemplate: "api/" + this.AreaName + "/{controller}/{id}", defaults: new { id = RouteParameter.Optional });
     if (route.DataTokens == null)
         route.DataTokens = new System.Web.Routing.RouteValueDictionary();
     route.DataTokens["area"] = this.AreaName;
 }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                null,
                url: "Error",
                defaults: new { controller = "Error", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                null,
                url: "NotFoundPage",
                defaults: new { controller = "Error", action = "NotFoundPage", id = UrlParameter.Optional },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                name: "lang",
                url: "{lang}/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                constraints : new { lang = @"ru|en" },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                name : "default",
                url : "{controller}/{action}/{id}",
                defaults : new { controller = "Home", action = "Index", id = UrlParameter.Optional, lang = "ru" },
                namespaces : new [] { "LessonProject.Areas.Default.Controllers" }
            );
        }
Ejemplo n.º 28
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            Config config = Config.Load();
            context.MapSubdomainRoute(
                 "Shortener.Index", // Route name
                 new List<string>() { "shorten", "s" }, // Subdomains
                 new List<string>() { config.Host }, // domains
                 "",    // URL with parameters 
                 new { controller = "Shortener", action = "Index" },  // Parameter defaults 
                 new[] { typeof(Controllers.ShortenerController).Namespace }
             );
            context.MapSubdomainRoute(
                 "Shortener.Action", // Route name
                 new List<string>() { "shorten", "s" }, // Subdomains
                 new List<string>() { config.Host }, // domains
                 "Action/{action}",    // URL with parameters 
                 new { controller = "Shortener", action = "Index" },  // Parameter defaults 
                 new[] { typeof(Controllers.ShortenerController).Namespace }
             );
            context.MapSubdomainRoute(
                 "Shortener.View", // Route name
                 new List<string>() { string.Empty, "shortened" }, // Subdomains
                 new List<string>() { config.ShortenerConfig.ShortenerHost }, // domains
                 "{url}",    // URL with parameters 
                 new { controller = "Shortener", action = "RedirectToUrl" },  // Parameter defaults 
                 new[] { typeof(Controllers.ShortenerController).Namespace }
             );

            // Register Script Bundles
            BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/shortener", config.CdnHost).Include(
                      "~/Areas/Shortener/Scripts/Shortener.js"));
        }
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
       name: "Public_default",
         url: "{controller}/{action}/{id}",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
 }
Ejemplo n.º 30
0
        public override void RegisterArea(AreaRegistrationContext context) 
        {
            context.MapRoute(
                name: null,
                url: "Admin",
                defaults: new { controller = "Home", action = "Index" }
            );

            context.MapRoute(
                name: null,
                url: "AuthorAphorisms/FindGridView",
                defaults: new { controller = "AuthorAphorisms", action = "FindGridView" }
            );

            context.MapRoute(
                name: null,
                url: "SiteTests/TestMatrix/{testId}/{page}",
                defaults: new { controller = "SiteTests", action = "TestMatrix" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     context.MapRoute(
         "Master_default",
         "Master/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional }
         );
 }
Ejemplo n.º 32
0
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     //如果更改后没有效果,清空web中bin文件夹的所有dll
     //此路由不能删除
     context.MapRoute("admin_default",
                      "admin/{controller}/{action}/{id}",
                      new { controller = "home", action = "index", area = "admin", id = UrlParameter.Optional },
                      new[] { "OWZX.Web.Admin.Controllers" });
 }
Ejemplo n.º 33
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute("Blog",
                             "Blog/{controller}/{action}/{id}",
                             new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                             new string[] { "Blog.Controllers" });

            base.RegisterArea(context);
        }
Ejemplo n.º 34
0
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     context.MapRoute(
         "_PageDraft_default",
         "_PageDraft/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional },
         new[] { "Kooboo.CMS.Modules.DiscardDraft", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
         );
     base.RegisterArea(context);
 }
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute(
                name: AreaName + "_default",
                url: AreaName + "/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Kooboo.Commerce.CMSIntegration.DataSources.Controllers" }
                );

            base.RegisterArea(context);
        }
Ejemplo n.º 36
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute(
                name: AreaName + "_default",
                url: AreaName + "/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Kooboo.Commerce.Shipping.ByWeight.Controllers", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
                );

            Kooboo.Web.Mvc.WebResourceLoader.ConfigurationManager.RegisterSection(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "WebResources.config"));

            base.RegisterArea(context);
        }
Ejemplo n.º 37
0
 public static Route MapRouteArea(this AreaRegistrationContext context, string name, string url, ActionResult result, object defaults, string[] namespaces)
 {
     return(MapRouteArea(context, name, url, result, defaults, null /*constraints*/, namespaces));
 }
Ejemplo n.º 38
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context, IApplicationBus bus)
        {
            #region SFSServiceDesk/Views/Shared/
            context.MapRoute("SFSServiceDesk_Views_Shared", "SFSServiceDesk/Views/Shared/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Views/Shared" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion

            #region SFSServiceDesk/Content/Themes/Default/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme", "SFSServiceDesk/Content/Themes/Default/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion
            #region SFSServiceDesk/Content/Themes/Default/css/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme_css", "SFSServiceDesk/Content/Themes/Default/css/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default/css" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion



            context.MapRoute("SFSServiceDesk_ResourceRoute_js", "SFSServiceDesk/Content/js/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/js" },
                             new string[] { "MvcContrib.PortableAreas" });



            #region SFSServiceDesk/Content/Themes/Default/img/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme_img", "SFSServiceDesk/Content/Themes/Default/img/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default/img" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion
            #region SFSServiceDesk/Content/img/
            context.MapRoute("SFSServiceDesk_ResourceRoute_img", "SFSServiceDesk/Content/img/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/img" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion

            context.MapRoute("SFSServiceDesk_ResourceImageRoute", "SFSServiceDesk/images/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "images" },
                             new string[] { "MvcContrib.PortableAreas" });

            context.MapRoute("SFSServiceDesk_Default",
                             "SFSServiceDesk/{controller}/{action}",
                             new { controller = "Home",
                                   action     = "index" },
                             new string[] { "SFS.ServiceDesk.Web.Mvc.Controllers" });

            context.MapRoute(
                "SFSServiceDesk_Id",                         // Route name
                "SFSServiceDesk/{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home",
                      action     = "Index",
                      id         = UrlParameter.Optional },
                new[] { "SFS.ServiceDesk.Web.Mvc.Controllers" });

            //context.MapRoute(
            // "SFSServiceDesk_usemode_Id", // Route name
            // "SFSServiceDesk/{controller}/usemode/{usemode}/{action}/{id}", // URL with parameters
            // new
            // {
            //     controller = "Home",
            //     action = "Index",
            //     id = UrlParameter.Optional
            // },
            //     new[] { "SFS.ServiceDesk.Web.Mvc.Controllers"
            //      });



            //ControllerBuilder.Current.DefaultNamespaces.Add("SFS.ServiceDesk.Web.Mvc.Controllers");

            this.RegisterAreaEmbeddedResources();
            if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["AutoInjectPermissionsOnStartup"]))
            {
                SecuritySettings.PermissionsInitialization();
            }

            OnAreaRegistration(this, new EventArgs());
        }
Ejemplo n.º 39
0
        public static void RegisterScripts(this PortableAreaRegistration portableArea, System.Web.Mvc.AreaRegistrationContext context, MvcContrib.PortableAreas.IApplicationBus bus)
        {
            bus.Send(new BusMessage {
                Message = portableArea.AreaName + " registered"
            });

            bus.Send(new DBScriptsMessage
            {
                AreaName    = portableArea.AreaName,
                LastVersion = GetLastDBScriptVersion(portableArea),
                Scripts     = GetScripts(portableArea)
            });
        }
Ejemplo n.º 40
0
 // Note: can't name the AreaRegistrationContext methods 'MapRoute', as that conflicts with the existing methods
 public static Route MapRouteArea(this AreaRegistrationContext context, string name, string url, ActionResult result)
 {
     return(MapRouteArea(context, name, url, result, null /*namespaces*/));
 }