• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Routing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Routing的典型用法代码示例。如果您正苦于以下问题:C# Routing类的具体用法?C# Routing怎么用?C# Routing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Routing类属于命名空间,在下文中一共展示了Routing类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Map

		public override void Map(Routing.Route route, IContainer container)
		{
			route.ThrowIfNull("route");
			container.ThrowIfNull("container");

			route.RestrictByUrlHostTypes(_hostTypes);
		}
开发者ID:kelong,项目名称:JuniorRoute,代码行数:7,代码来源:UrlHostTypeAttribute.cs


示例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;
            }
        }
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:26,代码来源:RoutingHelper.cs


示例3: Map

        public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            route.ResolveRelativeUrlsUsingString(_relativeUrl);
        }
开发者ID:nathan-alden,项目名称:junior-route,代码行数:7,代码来源:StringRelativeUrlResolverAttribute.cs


示例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;
     }
 }
开发者ID:kcitwm,项目名称:dova,代码行数:34,代码来源:RoutingProxyHandler.cs


示例5: Map

        public void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            _mapper.Map(route, container);
        }
开发者ID:nathan-alden,项目名称:junior-route,代码行数:7,代码来源:CustomMapperAttribute.cs


示例6: Map

        public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            route.RestrictByRefererUrlPorts(_ports);
        }
开发者ID:dblchu,项目名称:JuniorRoute,代码行数:7,代码来源:RefererUrlPortAttribute.cs


示例7: Map

        public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            route.RestrictByMethods(_methods);
        }
开发者ID:dblchu,项目名称:JuniorRoute,代码行数:7,代码来源:MethodAttribute.cs


示例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);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:8,代码来源:PdfPolicy.cs


示例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\" } });
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:8,代码来源:RoutingTest.cs


示例10: RegisterRoute_ThorwsExceptionWithDuplicateRoutes

        public void RegisterRoute_ThorwsExceptionWithDuplicateRoutes()
        {
            var routing = new Routing();
            var count = routing.Count;

            routing.RegisterRoute(_simpleRoute);
            routing.RegisterRoute(_simpleRoute);
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:8,代码来源:RoutingTest.cs


示例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);
 }
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:8,代码来源:New.ascx.cs


示例12: RouteMatchResult

        public RouteMatchResult(Routing.Route route, MatchResult result)
        {
            route.ThrowIfNull("route");
            result.ThrowIfNull("result");

            _route = route;
            _matchResult = result;
        }
开发者ID:nathan-alden,项目名称:junior-route,代码行数:8,代码来源:RouteMatchResult.cs


示例13: RegisterRoute_CanRegisterASimpleRoute

        public void RegisterRoute_CanRegisterASimpleRoute()
        {
            var routing = new Routing();
            var count = routing.Count;

            routing.RegisterRoute(_simpleRoute);

            Assert.AreEqual(count + 1, routing.Count);
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:9,代码来源:RoutingTest.cs


示例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);
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:9,代码来源:RoutingTest.cs


示例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();
        }
开发者ID:dblchu,项目名称:JuniorRoute,代码行数:9,代码来源:NoContentMapper.cs


示例16: FindRoute_CanFindARouteWithDashInName

        public void FindRoute_CanFindARouteWithDashInName()
        {
            var routing = new Routing();

            routing.RegisterRoute("import-keys", new Dictionary<string, ParameterType>() { { "path", ParameterType.Required } }, (p, c, s) => { }, "");

            var matchedRoute = routing.FindRoute("import-keys", new Dictionary<string, string>() { { "path", @"c:\temp\" } });

            Assert.AreEqual("import-keys", matchedRoute.Name);
        }
开发者ID:theouteredge,项目名称:cmdR,代码行数:10,代码来源:RoutingTest.cs


示例17: RegisterRoute_CanRegisterMultipleRoutesWithTheSameNameButDifferentParameteres

        public void RegisterRoute_CanRegisterMultipleRoutesWithTheSameNameButDifferentParameteres()
        {
            var routing = new Routing();
            var count = routing.Count;

            routing.RegisterRoute(_simpleRoute);
            routing.RegisterRoute(_singleParamRoute);

            Assert.AreEqual(count + 2, routing.Count);
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:10,代码来源:RoutingTest.cs


示例18: FindRoute_CanFindARouteWithARequiredParam

        public void FindRoute_CanFindARouteWithARequiredParam()
        {
            var routing = new Routing();
            
            routing.RegisterRoute(_simpleRoute);
            routing.RegisterRoute(_singleParamRoute);

            var matchedRoute = routing.FindRoute("ls", new Dictionary<string, string>() { { "path", @"c:\temp\" } });

            Assert.AreEqual(_singleParamRoute, matchedRoute);
        }
开发者ID:philberesford,项目名称:cmdR,代码行数:11,代码来源:RoutingTest.cs


示例19: MapAsync

        public Task MapAsync(Func<IContainer> container, Type type, MethodInfo method, Routing.Route route)
        {
            container.ThrowIfNull("container");
            type.ThrowIfNull("type");
            method.ThrowIfNull("method");
            route.ThrowIfNull("route");

            route.RespondWithNoContent();

            return Task.Factory.Empty();
        }
开发者ID:nathan-alden,项目名称:junior-route,代码行数:11,代码来源:NoContentMapper.cs


示例20: Map

        public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            if (_comparer != null)
            {
                route.RestrictByUrlSchemes(_schemes, GetComparer(_comparer.Value));
            }
            else
            {
                route.RestrictByUrlSchemes(_schemes);
            }
        }
开发者ID:dblchu,项目名称:JuniorRoute,代码行数:14,代码来源:UrlSchemeAttribute.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Rover类代码示例发布时间:2022-05-24
下一篇:
C# RoutedPropertyChangedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap