当前位置: 首页>>代码示例>>C#>>正文


C# RouteCollection.MapHubs方法代码示例

本文整理汇总了C#中RouteCollection.MapHubs方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapHubs方法的具体用法?C# RouteCollection.MapHubs怎么用?C# RouteCollection.MapHubs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RouteCollection的用法示例。


在下文中一共展示了RouteCollection.MapHubs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapHubs(new HubConfiguration
            {
                EnableCrossDomain = true
            });

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "WeatherByMonth",
                "weather/{station}/{year}/{month}",
                new { controller = "Weather", action = "ByMonth" }
            );

            routes.MapRoute(
                "WeatherByStation",
                "weather/{station}",
                new { controller = "Weather", action = "Index" }
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );
        }
开发者ID:mvanella,项目名称:kendo-ui-demos-service,代码行数:27,代码来源:Global.asax.cs

示例2: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.LowercaseUrls = true;
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // Map SignalR hubs
            routes.MapHubs();

            // Profile picture
            routes.MapRoute(
                name: "Profile picture",
                url: "users/profile/{id}/picture",
                defaults: new { controller = "Users", action = "ProfilePicture" }
            );

            routes.MapRoute(
                name: "OAuth2 Callback",
                url: "login/oauth2-callback",
                defaults: new {controller = "Login", action = "OAuth2_Callback"}
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:vktr,项目名称:toughlings-web,代码行数:27,代码来源:RouteConfig.cs

示例3: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHubs();
            routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
        }
开发者ID:davidthompson,项目名称:SignalRPlusEncodingTest,代码行数:7,代码来源:RouteConfig.cs

示例4: RegisterSignalR

        public static void RegisterSignalR(RouteCollection routes)
        {
            Ensure.That(() => routes).IsNotNull();

            // this special route is for SignalR hubs.
            routes.MapHubs("~/realtime");
        }
开发者ID:bevacqua,项目名称:bruttissimo,代码行数:7,代码来源:Routing.cs

示例5: Register

        public static void Register(RouteCollection routes)
        {
            const string connectionString = "Data Source=(local);Initial Catalog=SignalRBackend;Integrated Security=SSPI;Asynchronous Processing=True;";
            //GlobalHost.DependencyResolver.UseSqlServer(connectionString);

            var hubConfig = new HubConfiguration { EnableCrossDomain = true };
            routes.MapHubs(hubConfig);
        }
开发者ID:ChristianWeyer,项目名称:tUdUs,代码行数:8,代码来源:HubConfig.cs

示例6: RegisterSignalR

 public static void RegisterSignalR(RouteCollection routes)
 {
     if (routes == null)
     {
         throw new ArgumentNullException("routes");
     }
     // this special route is for SignalR hubs.
     routes.MapHubs("~/realtime");
 }
开发者ID:bevacqua,项目名称:Swarm,代码行数:9,代码来源:Routing.cs

示例7: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapConnection<SendingConnection>("sending-connection", "sending-connection");
            routes.MapConnection<TestConnection>("test-connection", "test-connection");
            routes.MapConnection<RawConnection>("raw-connection", "raw-connection");
            routes.MapConnection<StreamingConnection>("streaming-connection", "streaming-connection");

            // Register the default hubs route /signalr
            routes.MapHubs(new HubConfiguration() { EnableDetailedErrors = true });
        }
开发者ID:stirno,项目名称:SignalR,代码行数:10,代码来源:RouteConfig.cs

示例8: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes) {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHubs();
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}",
                defaults: new { controller = "Test", action = "Index" }
            );
        }
开发者ID:nwillems,项目名称:Gate.Adapters.AspNet,代码行数:10,代码来源:RouteConfig.cs

示例9: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.MapHubs(new HubConfiguration() { EnableCrossDomain = true });
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     routes.MapRoute(
         name: "Default",
         url: "{controller}/{action}/{id}",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
     );
 }
开发者ID:shoobah,项目名称:Strudle,代码行数:10,代码来源:RouteConfig.cs

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapConnection<SendingConnection>("sending-connection", "sending-connection/{*operation}");
            routes.MapConnection<TestConnection>("test-connection", "test-connection/{*operation}");
            routes.MapConnection<RawConnection>("raw-connection", "raw-connection/{*operation}");
            routes.MapConnection<StreamingConnection>("streaming-connection", "streaming-connection/{*operation}");

            // Register the default hubs route: ~/signalr/hubs
            routes.MapHubs();
        }
开发者ID:nonintanon,项目名称:SignalR,代码行数:10,代码来源:RouteConfig.cs

示例11: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     //routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     var config = new HubConfiguration
     {
         EnableCrossDomain = true,
         EnableDetailedErrors = true
     };
     routes.MapHubs(config);
     routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
 }
开发者ID:Chattingku,项目名称:CDN,代码行数:11,代码来源:Global.asax.cs

示例12: TestMapHubs

        public void TestMapHubs()
        {
            RouteCollection routes = new RouteCollection();
            bool delegateInvoked = false;
            routes.MapHubs("signalr", new HubConfiguration(), appbuilder =>
            {
                appbuilder.Properties[ServerRequestFacts.OwinConstants.HostAppNameKey] = "test";
                delegateInvoked = true;
            });

            Assert.True(delegateInvoked);
        }
开发者ID:hallco978,项目名称:SignalR,代码行数:12,代码来源:RouteExtensionsTest.cs

示例13: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes, ref RouteBase signalRHubRoute)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            signalRHubRoute = routes.MapHubs();

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:noobouse,项目名称:NGChat,代码行数:12,代码来源:RouteConfig.cs

示例14: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHubs("~/signalr");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new {controller = "Ships", action = "Index", id = UrlParameter.Optional} // Parameter defaults
                );
        }
开发者ID:worldspawn,项目名称:Loveboat,代码行数:12,代码来源:Global.asax.cs

示例15: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            // Register the default hubs route: ~/signalr
            routes.MapHubs();

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:DerekAlfonso,项目名称:sqrl-net,代码行数:13,代码来源:RouteConfig.cs


注:本文中的RouteCollection.MapHubs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。