Beispiel #1
0
        /// <summary>
        /// Adds a Path Edge to the supplied To Location Node
        /// </summary>
        /// <param name="ToLocationNode">The Location Node at the end of the path</param>
        /// <param name="PathElectrifcation">The available electrification of the path</param>
        /// <param name="PathLength">The path length</param>
        /// <param name="PathDirection">The path direction</param>
        public void AddPathEdge(LocationNode ToLocationNode, Electrification PathElectrifcation, Length PathLength, SimSigPathDirection PathDirection)
        {
            //Validate arguments
            ArgumentValidation.ValidateLocationNode(ToLocationNode, Globals.UserSettings.GetCultureInfo());

            if (this.ID == 0)
            {
                ExceptionHelper.GetStaticException("AddPathEdgeFromLocationNodeError", null, Globals.UserSettings.GetCultureInfo());
            }

            if (ToLocationNode.ID == 0)
            {
                ExceptionHelper.GetStaticException("AddPathEdgeToLocationNodeError", null, Globals.UserSettings.GetCultureInfo());
            }

            PathEdge NewPathEdge = new PathEdge(this, ToLocationNode, PathElectrifcation, PathLength, PathDirection, this._SQLConnector);

            NewPathEdge.SaveToSQLDB();
            this._PathEdges.Add(NewPathEdge);
        }