本文整理汇总了C#中Routing类的典型用法代码示例。如果您正苦于以下问题:C# Routing类的具体用法?C# Routing怎么用?C# Routing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Routing类属于命名空间,在下文中一共展示了Routing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public override void Map(Routing.Route route, IContainer container)
{
route.ThrowIfNull("route");
container.ThrowIfNull("container");
route.RestrictByUrlHostTypes(_hostTypes);
}
示例2: IsRoutingEqual
public static bool IsRoutingEqual(Routing routing1, Routing routing2)
{
if (routing1 == null && routing2 == null)
{
return true;
}
if (routing1 == null && routing2 != null)
{
return false;
}
if (routing1 != null && routing2 == null)
{
return false;
}
if (routing1.Code == routing2.Code)
{
return true;
}
else
{
return false;
}
}
示例3: Map
public override void Map(Routing.Route route, IContainer container)
{
route.ThrowIfNull("route");
container.ThrowIfNull("container");
route.ResolveRelativeUrlsUsingString(_relativeUrl);
}
示例4: Routing
/// <summary>
/// 根据Message路由接收端
/// </summary>
/// <param name="serviceName"></param>
/// <param name="msg"></param>
/// <returns></returns>
protected virtual Routing Routing(string serviceName, object msg)
{
PlugingItem plug = services[serviceName];
WQMessage imsg = msg as WQMessage;
try
{
Routing routing = null;
if (!routings.ContainsKey(plug.RoutingGroupName) || !routings[plug.RoutingGroupName].ContainsKey(imsg.RoutingKey))
{
if (plug.GroupName != "")
{
Log.Write(LogAction.Info, className, "Routing", serviceName, -1, "没有找到路由,用GroupName默认代替:plug.GroupName:" + plug.GroupName);
routing = new Routing();
routing.GroupName = plug.GroupName;
return routing;
}
return null;
}
routing = routings[plug.RoutingGroupName][imsg.RoutingKey];
Log.Write(LogAction.Info, className, "Routing" , serviceName, -1, imsg.TransactionID+":找到路由:Routing:" + routing);
return routing;
}
catch (Exception e)
{
Log.Write(LogAction.Error, className, "Routing", serviceName, -1, "serviceName:" + serviceName + ",msg:" + imsg.TransactionID + ",没有找到路由:plug.RoutingGroupName:" + plug.RoutingGroupName + ",imsg.RoutingKey:" + imsg.RoutingKey + "," + e.ToString());
return null;
}
}
示例5: Map
public void Map(Routing.Route route, IContainer container)
{
route.ThrowIfNull("route");
container.ThrowIfNull("container");
_mapper.Map(route, container);
}
示例6: Map
public override void Map(Routing.Route route, IContainer container)
{
route.ThrowIfNull("route");
container.ThrowIfNull("container");
route.RestrictByRefererUrlPorts(_ports);
}
示例7: Map
public override void Map(Routing.Route route, IContainer container)
{
route.ThrowIfNull("route");
container.ThrowIfNull("container");
route.RestrictByMethods(_methods);
}
示例8: ApplyOption
private void ApplyOption(IAction action, bool convertToPdf, Routing routing)
{
if (!convertToPdf)
{
IPolicyChannel smtpChannel = Template[TemplatePolicy.PdfPolicy, ChannelType.SMTP];
Template.RemoveAction(smtpChannel, routing, action);
}
}
示例9: FindRoute_ThrowsAnExcpetionWhenNotRoutesMatched
public void FindRoute_ThrowsAnExcpetionWhenNotRoutesMatched()
{
var routing = new Routing();
routing.RegisterRoute(_simpleRoute);
var matchedRoute = routing.FindRoute("ls", new Dictionary<string, string>() { { "path", @"c:\temp\" } });
}
示例10: RegisterRoute_ThorwsExceptionWithDuplicateRoutes
public void RegisterRoute_ThorwsExceptionWithDuplicateRoutes()
{
var routing = new Routing();
var count = routing.Count;
routing.RegisterRoute(_simpleRoute);
routing.RegisterRoute(_simpleRoute);
}
示例11: ODS_Routing_Inserting
protected void ODS_Routing_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
{
Controls_TextBox tbRegion = ((Controls_TextBox)(this.FV_Routing.FindControl("tbRegion")));
CodeMstrDropDownList ddlRoutingType = ((CodeMstrDropDownList)(this.FV_Routing.FindControl("ddlRoutingType")));
routing = (Routing)e.InputParameters[0];
routing.Type = ddlRoutingType.SelectedValue;
routing.Region = TheRegionMgr.LoadRegion(tbRegion.Text);
}
示例12: RouteMatchResult
public RouteMatchResult(Routing.Route route, MatchResult result)
{
route.ThrowIfNull("route");
result.ThrowIfNull("result");
_route = route;
_matchResult = result;
}
示例13: RegisterRoute_CanRegisterASimpleRoute
public void RegisterRoute_CanRegisterASimpleRoute()
{
var routing = new Routing();
var count = routing.Count;
routing.RegisterRoute(_simpleRoute);
Assert.AreEqual(count + 1, routing.Count);
}
示例14: FindRoute_CanFindASimpleRoute
public void FindRoute_CanFindASimpleRoute()
{
var routing = new Routing();
routing.RegisterRoute(_simpleRoute);
var matchedRoute = routing.FindRoute("ls", new Dictionary<string, string>());
Assert.AreEqual(_simpleRoute, matchedRoute);
}
示例15: Map
public void Map(Func<IContainer> container, Type type, MethodInfo method, Routing.Route route)
{
container.ThrowIfNull("container");
type.ThrowIfNull("type");
method.ThrowIfNull("method");
route.ThrowIfNull("route");
route.RespondWithNoContent();
}