本文整理汇总了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();
}
示例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 });
}
示例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 } // 参数默认值
);
}
示例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}");
}
示例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 });
}
示例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);
}
示例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 }
);
}
示例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);
}
示例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 }
);
}
示例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 }
);
}
示例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 }
);
}
示例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
);
}
示例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 }
);
}
示例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);
}
示例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 }
);
}