Example #1
0
        /// <summary>
        /// Creates a route with the given locations. Now route is stored in argument.
        /// This makes it impossible to have doubles. :( But makes drawing etc easy.
        /// </summary>
        /// <param name="locations"></param>
        /// <returns></returns>
        public static Route CreateRoute(params INetworkLocation[] locations)
        {
            var network = locations[0].Branch.Network;

            ThrowIfInputInvalid(locations, network);

            var route = new Route
            {
                Network = network,
            };

            route.Components[0].Unit = new Unit("meters", "m");
            route.SetLocations(locations);
            return(route);
        }
Example #2
0
        /// <summary>
        /// Creates a route with the given locations. Now route is stored in argument.
        /// This makes it impossible to have doubles. :( But makes drawing etc easy.
        /// </summary>
        /// <param name="locations"></param>
        /// <returns></returns>
        public static Route CreateRoute(params INetworkLocation[] locations)
        {
            var network = locations[0].Branch.Network;

            ThrowIfInputInvalid(locations, network);

            var route = new Route
                            {
                                Network = network,
                            };
            route.Components[0].Unit = new Unit("meters", "m");
            route.SetLocations(locations);
            return route;
        }