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


C# IRoute.Contains方法代码示例

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


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

示例1: Process

        public IRouteResult Process(IRoute route)
        {
            if (_presenter == null)
                return new EndRouteResult(route);

            if (!route.Contains(KnownParameters.Errors))
                throw new NoErrorsFoundToShowException(route);

            var errors = route[KnownParameters.Errors] as IEnumerable<IError>;
            _presenter.Show(route, errors);

            return new EndRouteResult(route);
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:13,代码来源:ErrorPresenterProcessor.cs

示例2: GetParameters

        object[] GetParameters(IRoute route, MethodInfo method)
        {
            var parameters = new List<object>();
            foreach (var p in method.GetParameters())
            {
                if (route.Contains(p.Name))
                {
                    parameters.Add(route[p.Name]);
                }
                else
                {
                    parameters.Add(IoC.Get(p.ParameterType));
                }
            }

            return parameters.ToArray();
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:17,代码来源:Listener.cs

示例3: Improve

        /// <summary>
        /// Tries to improve the existing route using CI and return true if succesful.
        /// </summary>
        /// <param name="problem"></param>
        /// <param name="route"></param>
        /// <param name="difference"></param>
        /// <returns></returns>
        public bool Improve(IProblemWeights problem, IRoute route, out double difference)
        {
            bool improvement = false;

            difference = 0;
            if (route.Count > 3)
            {
                // loop over all customers and try cheapest insertion.
                for (int customer = 0; customer < problem.Size; customer++)
                {
                    //string route_string = route.ToString();
                    //IRoute previous = route.Clone() as IRoute;
                    if (route.Contains(customer))
                    {
                        // remove customer and keep position.
                        int next = route.GetNeigbours(customer)[0];
                        route.Remove(customer);

                        // insert again.
                        ArbitraryInsertionSolver.InsertOne(problem, route, customer, out difference);

                        if (!route.IsValid())
                        {
                            throw new Exception();
                        }
                        if (route.GetNeigbours(customer)[0] != next
                            && difference < 0)
                        { // another customer was found as the best, improvement is succesful.
                            improvement = true;
                            break;
                        }
                    }
                }
            }
            return improvement;
        }
开发者ID:UnifyKit,项目名称:OsmSharp,代码行数:43,代码来源:ArbitraryInsertionSolver.cs

示例4: CanProcess

 public bool CanProcess(IRoute route)
 {
     return route.Contains(KnownParameters.Errors)
            && !route.Resource.Matches("errors");
 }
开发者ID:RookieOne,项目名称:Chimera,代码行数:5,代码来源:ErrorProcessor.cs

示例5: CanProcess

 public bool CanProcess(IRoute route)
 {
     return route.Contains(KnownParameters.View)
            && route.Contains(KnownParameters.ShowAs);
 }
开发者ID:RookieOne,项目名称:Chimera,代码行数:5,代码来源:ViewPresenterProcessor.cs

示例6: CanProcess

 public bool CanProcess(IRoute route)
 {
     return route.Contains(KnownParameters.Listener)
            && route.DoesNotContain(KnownParameters.ProcessedByListener);
 }
开发者ID:RookieOne,项目名称:Chimera,代码行数:5,代码来源:ListenerProcessor.cs

示例7: CanProcess

 public bool CanProcess(IRoute route)
 {
     return route.Contains(KnownParameters.Controller)
            && !route.Contains(KnownParameters.ProcessedByController);
 }
开发者ID:RookieOne,项目名称:Chimera,代码行数:5,代码来源:ControllerProcessor.cs

示例8: CanProcessFilter

 public override bool CanProcessFilter(IRoute route)
 {
     return !route.Contains(KnownParameters.Controller);
 }
开发者ID:RookieOne,项目名称:Chimera,代码行数:4,代码来源:ControllerFactoryProcessor.cs


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