本文整理汇总了C#中IRouteHandler类的典型用法代码示例。如果您正苦于以下问题:C# IRouteHandler类的具体用法?C# IRouteHandler怎么用?C# IRouteHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRouteHandler类属于命名空间,在下文中一共展示了IRouteHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RewriteLowerCaseUrlRoute
/// <summary>
/// 初始化一个<see cref="RewriteLowerCaseUrlRoute"/>类的新实例
/// </summary>
/// <param name="url"> </param>
/// <param name="defaults"> </param>
/// <param name="constraints"> </param>
/// <param name="dataTokens"> </param>
/// <param name="routeHandler"> </param>
public RewriteLowerCaseUrlRoute(string url,
RouteValueDictionary defaults,
RouteValueDictionary constraints,
RouteValueDictionary dataTokens,
IRouteHandler routeHandler)
: base(url, defaults, constraints, dataTokens, routeHandler)
{ }
开发者ID:donnieyoung,项目名称:osharp,代码行数:15,代码来源:RewriteLowerCaseUrlRoute.cs
示例2: UIRoute
/// <summary>
/// Initializes a new instance of the <see cref="UIRoute"/> class.
/// </summary>
/// <param name="url">The URL.</param>
/// <param name="defaults">The defaults.</param>
/// <param name="routeHandler">The route handler.</param>
public UIRoute(string url, RouteValueDictionary defaults, IRouteHandler routeHandler)
: base(url, defaults, routeHandler)
{
_url = url;
_defaults = defaults;
_routeHandler = routeHandler;
}
开发者ID:sriv,项目名称:BrickPile,代码行数:13,代码来源:UIRoute.cs
示例3: MapRoute
public static void MapRoute(this RouteCollection routes, string name, string url, object defaults, object constraints, IRouteHandler routeHandler)
{
var newRoute = new NamedRoute(name, url, routeHandler);
newRoute.Defaults = new RouteValueDictionary(defaults);
newRoute.Constraints = new RouteValueDictionary(constraints);
routes.Add(name, newRoute);
}
开发者ID:bjeverett,项目名称:asp-net-mvc-unleashed,代码行数:7,代码来源:RouteCollectionExtensions.cs
示例4: GetRequestContext
static Mock<RequestContext> GetRequestContext(string requestUrl, string routeUrl, IRouteHandler handler)
{
var route = new Route(routeUrl, handler);
var sv = new Mock<NameValueCollection>(MockBehavior.Strict);
sv.Setup(m => m.Get("IIS_UrlRewriteModule")).Returns((string)null);
var req = new Mock<HttpRequestBase>(MockBehavior.Strict);
req.Setup(m => m.AppRelativeCurrentExecutionFilePath).Returns("~/");
req.Setup(m => m.PathInfo).Returns(requestUrl);
req.Setup(m => m.ApplicationPath).Returns("/");
req.Setup(m => m.ServerVariables).Returns(sv.Object);
var resp = new Mock<HttpResponseBase>(MockBehavior.Strict);
resp.Setup(m => m.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(url => url);
var ctx = new Mock<HttpContextBase>(MockBehavior.Strict);
ctx.Setup(m => m.Request).Returns(req.Object);
ctx.Setup(m => m.Response).Returns(resp.Object);
var reqCtx = new Mock<RequestContext>(MockBehavior.Strict);
reqCtx.Setup(m => m.HttpContext).Returns(ctx.Object);
reqCtx.Setup(m => m.RouteData).Returns(route.GetRouteData(ctx.Object));
return reqCtx;
}
开发者ID:paultyng,项目名称:SeoRouting,代码行数:26,代码来源:RedirectionHelper.cs
示例5: CultureSensitiveRouteHandler
public CultureSensitiveRouteHandler(IRouteHandler routeHandler)
{
RouteHandler = routeHandler;
SetCurrentCulture = true;
SetCurrentUICulture = true;
}
开发者ID:CiprianPorumbescu,项目名称:RouteLocalizationMVC,代码行数:7,代码来源:CultureSensitiveRouteHandler.cs
示例6: SimpleRouteTable
/// <summary>
/// 创建一个简单路由表实例
/// </summary>
/// <param name="name">简单路由表名称</param>
/// <param name="handler">处理路由请求的对象</param>
/// <param name="mvcCompatible">是否产生MVC兼容的虚拟路径(去除~/)</param>
public SimpleRouteTable( string name, IRouteHandler handler, bool mvcCompatible )
{
Name = name;
Handler = handler;
MvcCompatible = mvcCompatible;
UrlEncoding = Encoding.UTF8;
}
开发者ID:neo2018,项目名称:Jumony,代码行数:13,代码来源:SimpleRouteTable.cs
示例7: ContentNegotiationRouteProxy
/// <summary>
/// Creates a new ContentNegotiationRouteProxy.
/// </summary>
/// <param name="proxiedHandler">The handler to proxy, typically an MvcRouteHandler</param>
/// <param name="map">The map containing the associations between media types and formats</param>
/// <param name="priority">Whether the client sets the priority or the server. The HTTP spec
/// indicates that the client should set it, but on occasion the server may need to set it
/// to work around bugs in browsers (e.g. Chrome prioritizes xml over html).</param>
public ContentNegotiationRouteProxy(IRouteHandler proxiedHandler, MediaTypeFormatMap map,
ConnegPriorityGivenTo priority = ConnegPriorityGivenTo.Client)
{
this.proxiedHandler = proxiedHandler;
this.map = map;
this.priority = priority;
}
开发者ID:abombss,项目名称:RestMvc,代码行数:15,代码来源:ContentNegotiationRouteProxy.cs
示例8: TranslationRoute
public TranslationRoute(string url, RouteValueDictionary defaults, RouteValueDictionary constraints,
RouteValueDictionary dataTokens, IRouteHandler routeHandler)
: base(url, defaults, constraints, dataTokens, routeHandler)
{
TranslationRouteRoot = this;
TranslatedRoutes = new Dictionary<string, TranslationRoute>();
}
开发者ID:CiprianPorumbescu,项目名称:RouteLocalizationMVC,代码行数:7,代码来源:TranslationRoute.cs
示例9: ShortyRoute
public ShortyRoute(string url, RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens, IRouteHandler routeHandler)
: base(url, defaults, constraints, dataTokens, routeHandler)
{
if (string.IsNullOrEmpty(url)) throw new ArgumentNullException("Route url must be defined", "url");
var thisUrl = url;
}
开发者ID:maxkimambo,项目名称:urlshortener,代码行数:7,代码来源:RouteConfig.cs
示例10: Route
public Route(string url, RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens, IRouteHandler routeHandler) {
Url = url;
Defaults = defaults;
Constraints = constraints;
DataTokens = dataTokens;
RouteHandler = routeHandler;
}
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:Route.cs
示例11: LocaleRoute
public LocaleRoute(
string pattern,
RouteValueDictionary defaults,
RouteValueDictionary constraints,
RouteValueDictionary tokens,
string[] namespaces,
IRouteHandler routeHandler)
{
var localeConstraints = new RouteValueDictionary(constraints);
localeConstraints.Add("locale", @"[a-zA-Z]{2}");
_routeWithLocale = new Route(
@"{locale}/" + pattern,
defaults,
localeConstraints,
tokens,
new LocaleRouteHandler(routeHandler));
_routeWithoutLocale = new Route(
pattern,
defaults,
constraints,
tokens,
new LocaleRouteHandler(routeHandler));
if(namespaces != null && namespaces.Any()) {
_routeWithLocale.DataTokens["Namespaces"] = namespaces;
_routeWithoutLocale.DataTokens["Namespaces"] = namespaces;
}
}
开发者ID:jasonholloway,项目名称:brigita,代码行数:30,代码来源:LocaleRoutes.cs
示例12: NamedRoute
public NamedRoute(string name, string displayName, string url, RouteValueDictionary defaults, RouteValueDictionary constraints,
RouteValueDictionary dataTokens, IRouteHandler routeHandler)
: base(url, defaults, constraints, dataTokens, routeHandler)
{
_name = name;
_displayName = displayName;
}
开发者ID:planet95,项目名称:proSEOMVC,代码行数:7,代码来源:NamedRoute.cs
示例13: PortalableRoute
public PortalableRoute(string url, RouteValueDictionary constraints, IRouteHandler routeHandler)
: base(url, null, constraints, routeHandler)
{
//Url = url;
//Constraints = constraints;
//RouteHandler = routeHandler;
}
开发者ID:Epsolone,项目名称:ecps,代码行数:7,代码来源:PortalableRoute.cs
示例14: KarbonRoute
/// <summary>
/// Initializes a new instance of the <see cref="KarbonRoute"/> class.
/// </summary>
/// <param name="url">The URL pattern for the route.</param>
/// <param name="routeHandler">The object that processes requests for the route.</param>
public KarbonRoute(string url,
IRouteHandler routeHandler)
: base(url, routeHandler)
{
_url = url;
_routeHandler = routeHandler;
}
开发者ID:TSalaam,项目名称:karbon-cms,代码行数:12,代码来源:KarbonRoute.cs
示例15: RouteData
public RouteData(RouteBase route, IRouteHandler routeHandler)
{
this._values = new RouteValueDictionary();
this._dataTokens = new RouteValueDictionary();
this.Route = route;
this.RouteHandler = routeHandler;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:RouteData.cs
示例16: ItemRoute
public ItemRoute(
string url,
RouteValueDictionary defaults,
RouteValueDictionary constraints,
IRouteHandler routeHandler)
: base(url, defaults, constraints, routeHandler)
{
}
开发者ID:rajendra1809,项目名称:VirtoCommerce,代码行数:8,代码来源:ItemRoute.cs
示例17: SeoRoute
public SeoRoute(string url, IRouteHandler routeHandler, Func<WorkContext> workContextFactory, ICommerceCoreModuleApi commerceCoreApi, IStaticContentService staticContentService, ICacheManager<object> cacheManager)
: base(url, routeHandler)
{
_workContextFactory = workContextFactory;
_commerceCoreApi = commerceCoreApi;
_contentService = staticContentService;
_cacheManager = cacheManager;
}
开发者ID:adwardliu,项目名称:vc-community,代码行数:8,代码来源:SeoRoute.cs
示例18: SeoRouteHandler
public SeoRouteHandler(IRouteHandler inner, bool forceTrailingSlash, bool forceLowerCase)
{
if (inner == null) throw new ArgumentNullException("inner");
_inner = inner;
_forceTrailingSlash = forceTrailingSlash;
_forceLowerCase = forceLowerCase;
}
开发者ID:paultyng,项目名称:SeoRouting,代码行数:8,代码来源:SeoRouteHandler.cs
示例19: RouteData
public RouteData(string controller, string action, IRouteHandler routeHandler)
{
this.Controller = controller;
this.Action = action;
this.RouteHandler = routeHandler;
this.Namespaces = RouteTable.Namespaces;
this.Assemblies = RouteTable.Assemblies;
}
开发者ID:proson,项目名称:project,代码行数:8,代码来源:RouteData.cs
示例20: AddPrefixRoute
public static IRouteBuilder AddPrefixRoute(
this IRouteBuilder routeBuilder,
string prefix,
IRouteHandler handler)
{
routeBuilder.Routes.Add(new PrefixRoute(handler, prefix));
return routeBuilder;
}
开发者ID:leloulight,项目名称:Routing,代码行数:8,代码来源:RouteBuilderExtensions.cs
注:本文中的IRouteHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论