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


C# RouteCollection.MapConnection方法代码示例

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


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

示例1: 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

示例2: 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

示例3: RegisterRoutes

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

            routes.MapConnection<AllotStockInConnection>("allotStockIn", "allotStockIn/{*operation}");
            routes.MapConnection<AllotStockOutConnection>("allotStockOut", "allotStockOut/{*operation}");
            routes.MapConnection<DispatchSortWorkConnection>("allotSortWork", "allotSortWork/{*operation}");
            routes.MapRoute(
                "Default", // 路由名称
                "{controller}/{action}/{SystemID}", // 带有参数的 URL
                new { controller = "Home", action = "Index", SystemID = UrlParameter.Optional } // 参数默认值
            );
        }
开发者ID:peoplesofter,项目名称:wms_rfid,代码行数:13,代码来源:Global.asax.cs

示例4: RegisterRoutes

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

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Chat", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapConnection<CommonDataConnection>("echo", "Data/Messages/Pipe/{*operation}");
            routes.MapConnection<DrawingDataConnection>("drawEcho", "Data/Drawing/Pipe/{*operation}");
        }
开发者ID:KristianKirov,项目名称:SocketChat,代码行数:13,代码来源:Global.asax.cs

示例5: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.LowercaseUrls = true;

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

            routes.MapRoute(
                "Root",
                string.Empty,
                defaults: new { controller = "Home", action = "Index" },
                constraints: new { httpMethod = new HttpMethodConstraint("GET") });

            routes.MapRoute(
                name: "About",
                url: "about",
                defaults: new { controller = "Home", action = "About" },
                constraints: new { httpMethod = new HttpMethodConstraint("GET") });

            routes.MapRoute(
                name: "validate",
                url: "validate",
                defaults: new { controller = "Home", action = "Validate" },
                constraints: new { httpMethod = new HttpMethodConstraint("POST") });

            routes.MapConnection<ExecuteEndPoint>("execute", "execute/{*operation}");

            routes.MapRoute(
                name: "Update",
                url: "{slug}/{version}",
                defaults: new { controller = "Home", action = "Save", version = UrlParameter.Optional },
                constraints: new { httpMethod = new HttpMethodConstraint("POST"), slug = @"[a-z0-9]*", });

            routes.MapRoute(
                name: "Save",
                url: "{slug}",
                defaults: new { controller = "Home", action = "Save", slug = UrlParameter.Optional },
                constraints: new { httpMethod = new HttpMethodConstraint("POST"), slug = @"[a-z0-9]*" });

            routes.MapRoute(
                name: "Show",
                url: "{slug}/{version}",
                defaults: new { controller = "Home", action = "Show", version = UrlParameter.Optional },
                constraints: new { httpMethod = new HttpMethodConstraint("GET"), slug = @"[a-z0-9]+", version = @"\d*" });

            routes.MapRoute(
                name: "Latest",
                url: "{slug}/latest",
                defaults: new { controller = "Home", action = "Latest" },
                constraints: new { httpMethod = new HttpMethodConstraint("GET"), slug = @"[a-z0-9]+" });

            routes.MapRoute(
                "Error",
                "Error/{status}",
                new { controller = "Error", action = "Index", status = UrlParameter.Optional });

            // 404s
            routes.MapRoute(
                "404", "{*url}", new { controller = "Error", action = "Index", status = 404 });
        }
开发者ID:vendettamit,项目名称:compilify,代码行数:59,代码来源:RouteConfig.cs

示例6: InstallRoutes

        static void InstallRoutes(RouteCollection routes)
        {
            var assetRoute = new Route("_instantcss/assets/{*path}", new AssetRouteHandler());
            routes.Insert(0, assetRoute);

            var connectionRoute = routes.MapConnection<ExpressCssConnection>("ExpressCss", "_instantcss/connection/{*operation}");
            routes.Remove(connectionRoute);
            routes.Insert(1, connectionRoute);
        }
开发者ID:modulexcite,项目名称:expresscss,代码行数:9,代码来源:Application.cs

示例7: RegisterRoutes

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

            routes.MapConnection<TourneyConnection>("games", "games/{*operation}");
            routes.MapConnection<TourConnection>("tourgames", "tourgames/{*operation}");

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Tours", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:Resounding,项目名称:Tourney,代码行数:19,代码来源:Global.asax.cs

示例8: RegisterRoutes

        private void RegisterRoutes(RouteCollection routeCollection)
        {
            routeCollection.MapConnection<TrackingViewerConnection>("tracking", "tracking/{*operation}");

            Route route = new Route("trackingviewer", new TrackingViewHttpHandlerRouteHandler());
            Route route2 = new Route("trackingviewer/{*value}", new TrackingViewHttpHandlerRouteHandler());

            routeCollection.Add("trackingviewerroute", route);
            routeCollection.Add("trackingviewerroute2", route2);
        }
开发者ID:PeteGoo,项目名称:Workflow-Service-Tracking-Viewer,代码行数:10,代码来源:Global.asax.cs

示例9: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapConnection<Clock>("clock", "clock/{*operation}");

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

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapConnection<DocumentConnection>("documents", "/signalr/documents/subscriptions");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

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

示例11: RegisterRoutes

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

            routes.MapConnection<GameConnection>("game", "/game");

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

示例12: RegisterRoutes

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

            routes.MapConnection<SignalConnection>("echo", "echo/{*operation}");

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

示例13: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapConnection<MessageConnection>("chat", "/chat");

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

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

示例14: TestMapConnectionWithType

        public void TestMapConnectionWithType()
        {
            RouteCollection routes = new RouteCollection();
            bool delegateInvoked = false;
            routes.MapConnection("signalr", "/test", typeof(MyGroupConnection), new ConnectionConfiguration(), appbuilder =>
            {
                appbuilder.Properties[ServerRequestFacts.OwinConstants.HostAppNameKey] = "test";
                delegateInvoked = true;
            });

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

示例15: RegisterRoutes

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

            //SignalR --  Needs to be done before other routes
            routes.MapConnection<Echo>("echo", "echo/{*operation}");

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


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