コード例 #1
0
        public static Route MapAsyncRoute(this RouteCollection routes, string name, string url, object defaults, object constraints, string[] namespaces)
        {
            Route route = RouteCollectionExtensions.MapRoute(routes, name, url, defaults, constraints, namespaces);

            route.RouteHandler = new MvcAsyncRouteHandler();
            return(route);
        }
コード例 #2
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            base.ApplicationStarted(umbracoApplication, applicationContext);

            RouteCollectionExtensions.MapRoute(RouteTable.Routes,
                                               "GigyaRoutes",
                                               "api/gigya/{controller}/{action}/{id}",
                                               new
            {
                controller = "Account",
                action     = "Login",
                id         = UrlParameter.Optional
            },
                                               new string[] { "Gigya.Umbraco.Module.Mvc.Controllers" }
                                               );

            RouteCollectionExtensions.MapRoute(RouteTable.Routes,
                                               "GigyaSettings",
                                               "GigyaSettings/{action}/{id}",
                                               new
            {
                controller = "GigyaSettings",
                action     = "Index",
                id         = UrlParameter.Optional
            },
                                               new string[] { "Gigya.Umbraco.Module.Mvc.Controllers" }
                                               );
        }
コード例 #3
0
 public void MapRoute5WithNullRouteCollectionThrows()
 {
     ExceptionHelper.ExpectArgumentNullException(
         delegate {
         RouteCollectionExtensions.MapRoute(null, null, null, null, null);
     },
         "routes");
 }
コード例 #4
0
ファイル: RouteConfig.cs プロジェクト: MManoj915/Autotime
 public static void RegisterRoutes(RouteCollection routes)
 {
     RouteCollectionExtensions.IgnoreRoute(routes, "{resource}.axd/{*pathInfo}");
     RouteCollectionExtensions.MapRoute(routes, "Default", "{controller}/{action}/{id}", (object)new
     {
         controller = "Login",
         action     = "Index",
         id         = (UrlParameter)UrlParameter.Optional
     });
 }
コード例 #5
0
 public void MapRoute5WithNullRouteCollectionThrows()
 {
     Assert.ThrowsArgumentNull(
         delegate
     {
         RouteCollectionExtensions.MapRoute(null, null, null, null, null);
     },
         "routes"
         );
 }
コード例 #6
0
 public void RegisterRoutes(RouteCollection routes)
 {
     RouteCollectionExtensions.MapRoute(routes, "NopFarsi.Payments.Zarinpal.Verify", "Plugins/ZarinpalNopFarsi/Verify", new
     {
         controller = "ZarinpalNopFarsi",
         action     = "Verify"
     }, new string[]
     {
         "NopFarsi.Payments.Zarinpal.Controllers"
     });
 }
コード例 #7
0
ファイル: RouteProvider.cs プロジェクト: yuyu2you/Caf.CMS
 public void RegisterRoutes(RouteCollection routes)
 {
     RouteCollectionExtensions.MapRoute(routes, "CAF.WebSite.CustomBanner", "Plugins/CustomBanner/{action}", new
     {
         controller = "CustomBanner",
         action     = "Configure"
     }, new string[]
     {
         "CAF.WebSite.CustomBanner.Controllers"
     }).DataTokens["area"] = "CAF.WebSite.CustomBanner";
 }
コード例 #8
0
 private void InitializeRoutes()
 {
     RouteCollectionExtensions.MapRoute(RouteTable.Routes,
                                        "GoogleAMPPagesRoute",
                                        "amp/{ampPageUrl}/{*itemUrl}",
                                        new
     {
         controller = "AmpPage",
         action     = "Index",
         ampPageUrl = (string)null,
         itemUrl    = (string)null
     });
 }
コード例 #9
0
        public void MapRoutes(System.Web.Routing.RouteCollection routeCollection)
        {
            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-events", "sitecore/api/habitatfitness/events/{action}", new
            {
                action     = "Index",
                controller = "HabitatFitnessEvents",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-products", "sitecore/api/habitatfitness/products/{action}", new
            {
                action     = "Index",
                controller = "HabitatFitnessProducts",
            });
        }
コード例 #10
0
ファイル: RouteConfig.cs プロジェクト: zmyz2013/RoadFlowMvc
 public static void RegisterRoutes(RouteCollection routes)
 {
     RouteTable.Routes.MapHubs();
     RouteTable.Routes.MapConnection <SignalRConnection>("roadflow", "roadflow");
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     RouteCollectionExtensions.MapRoute(namespaces: new string[1]
     {
         "WebMvc.Controllers"
     }, routes: routes, name: "Default", url: "{controller}/{action}/{id}", defaults: new
     {
         controller = "Home",
         action     = "Index",
         id         = UrlParameter.Optional
     });
 }
コード例 #11
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            RouteTable.Routes.MapHubs();
            RouteTable.Routes.MapConnection <SignalRConnection>("roadflow", "roadflow");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            RouteCollection routes1 = routes;
            string          name    = "Default";
            string          url     = "{controller}/{action}/{id}";

            string[] strArray = new string[1] {
                "WebMvc.Controllers"
            };
            var data = new{ controller = "Home", action = "Index", id = UrlParameter.Optional };

            string[] namespaces = strArray;
            RouteCollectionExtensions.MapRoute(routes1, name, url, (object)data, namespaces);
        }
コード例 #12
0
        public void MapRoutes(System.Web.Routing.RouteCollection routeCollection)
        {
            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-sesion", "sitecore/api/habitatfitness/session/{action}", new
            {
                controller = "HabitatFitnessSession",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-event-favorites", "sitecore/api/habitatfitness/events/favorites/{action}", new
            {
                controller = "HabitatFitnessEventFavorites",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-event-registration", "sitecore/api/habitatfitness/events/registration/{action}", new
            {
                controller = "HabitatFitnessEventRegistration",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-subscriptions", "sitecore/api/habitatfitness/subscription/{action}", new
            {
                controller = "HabitatFitnessSubscriptions",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-demographics", "sitecore/api/habitatfitness/demographics/{action}", new
            {
                controller = "HabitatFitnessDemographics",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-sports", "sitecore/api/habitatfitness/sports/{action}", new
            {
                controller = "HabitatFitnessSports",
            });

            RouteCollectionExtensions.MapRoute(routeCollection, "habitathome-fitness-identification", "sitecore/api/habitatfitness/identification/{action}", new
            {
                controller = "HabitatFitnessIdentification",
            });
        }
コード例 #13
0
        /// <summary>
        /// Registers the Module module.
        /// </summary>
        private static void RegisterModule()
        {
            var restart       = false;
            var configManager = ConfigManager.GetManager();

            // check if Sitefinity has been installed
            var dataconfig = configManager.GetSection <DataConfig>();

            if (dataconfig == null || !dataconfig.Initialized || dataconfig.ConnectionStrings.Count == 0)
            {
                return;
            }

            var modulesConfig = configManager.GetSection <SystemConfig>().ApplicationModules;

            if (!modulesConfig.Elements.Any(el => el.GetKey().Equals(ModuleClass.ModuleName)))
            {
                modulesConfig.Add(ModuleClass.ModuleName, new AppModuleSettings(modulesConfig)
                {
                    Name        = ModuleClass.ModuleName,
                    Title       = ModuleClass.ModuleTitle,
                    Description = ModuleClass.ModuleDescription,
                    Type        = typeof(ModuleClass).AssemblyQualifiedName,
                    StartupType = StartupType.OnApplicationStart
                });

                configManager.SaveSection(modulesConfig.Section);

                restart = true;
            }

            // register widgets
            restart = ModuleClass.RegisterControl("GigyaSettings", "Gigya Settings", typeof(GigyaSettingsController), "PageControls", ModuleClass.WidgetSectionName, "Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy") || restart;
            restart = ModuleClass.RegisterControl("GigyaLogin", "Gigya Login", typeof(GigyaLoginController), "PageControls", ModuleClass.WidgetSectionName, "Gigya.Module.Mvc.Proxy.MvcControllerProxyNoCache") || restart;
            restart = ModuleClass.RegisterControl("GigyaLogout", "Gigya Logout", typeof(GigyaLogoutController), "PageControls", ModuleClass.WidgetSectionName, "Gigya.Module.Mvc.Proxy.MvcControllerProxyNoCache") || restart;
            restart = ModuleClass.RegisterControl("GigyaRegister", "Gigya Register", typeof(GigyaRegisterController), "PageControls", ModuleClass.WidgetSectionName, "Gigya.Module.Mvc.Proxy.MvcControllerProxyNoCache") || restart;
            restart = ModuleClass.RegisterControl("GigyaEditProfile", "Gigya Edit Profile", typeof(GigyaEditProfileController), "PageControls", ModuleClass.WidgetSectionName, "Gigya.Module.Mvc.Proxy.MvcControllerProxyNoCache") || restart;

            if (restart)
            {
                SystemManager.RestartApplication(OperationReason.KnownKeys.DynamicModuleInstall);
            }

            try
            {
                // custom WCF service installation
                SystemManager.RegisterWebService(typeof(GigyaSettingsService), GigyaSettingsService.WebServiceUrl);

                RouteCollectionExtensions.MapRoute(RouteTable.Routes,
                                                   "GigyaRoutes",
                                                   "api/gigya/{controller}/{action}/{id}",
                                                   new
                {
                    controller = "Account",
                    action     = "Login",
                    id         = UrlParameter.Optional
                },
                                                   new string[] { "Gigya.Module.Mvc.Controllers" }
                                                   );

                ObjectFactory.Container.RegisterType <GigyaMembershipHelper, GigyaMembershipHelper>("GigyaMembershipHelper",
                                                                                                    new ContainerControlledLifetimeManager());

                EventHub.Subscribe <IPagePreRenderCompleteEvent>(OnPagePreRenderCompleteEventHandler);
            }
            catch (Exception e)
            {
            }
        }