예제 #1
0
 /// <summary>
 /// Removes the supplied PathEdge from the Path Edge collection
 /// </summary>
 /// <param name="LocationNodePathEdge"></param>
 /// <remarks>Removing the path edge from the collection will also delete it from the GroundFrame.SQL database</remarks>
 public void RemovePathEdge(PathEdge LocationNodePathEdge)
 {
     //Validate Arguments
     ArgumentValidation.ValidatePathEdge(LocationNodePathEdge, Globals.UserSettings.GetCultureInfo());
     this._PathEdges.Remove(LocationNodePathEdge);
     LocationNodePathEdge.DeleteFromSQLDB();
 }
예제 #2
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);
        }