コード例 #1
0
        /// <summary>
        /// Builds a route.
        /// </summary>
        public override sealed Result <Route> BuildRoute <T>(Profile profile, WeightHandler <T> weightHandler, RouterPoint source, RouterPoint target, EdgePath <T> path)
        {
            if (this.CustomRouteBuilder != null)
            { // there is a custom route builder.
                return(this.CustomRouteBuilder.TryBuild(_db, profile, source, target, path));
            }

            // use the default.
            return(CompleteRouteBuilder.TryBuild(_db, profile, source, target, path));
        }
コード例 #2
0
        /// <summary>
        /// Builds a route.
        /// </summary>
        public override sealed Result <Route> BuildRoute <T>(IProfileInstance profileInstance, WeightHandler <T> weightHandler, RouterPoint source, RouterPoint target, EdgePath <T> path)
        {
            try
            {
                if (this.CustomRouteBuilder != null)
                { // there is a custom route builder.
                    return(this.CustomRouteBuilder.TryBuild(_db, profileInstance.Profile, source, target, path));
                }

                // use the default.
                return(CompleteRouteBuilder.TryBuild(_db, profileInstance.Profile, source, target, path));
            }
            catch (Exception ex)
            {
                return(new Result <Route>(ex.Message, (m) => ex));
            }
        }