예제 #1
0
파일: MapData.cs 프로젝트: kurtrips/tc
 /// <summary>
 /// Gets the port in the mapData for the given id.
 /// </summary>
 /// <param name="portId">The port id</param>
 /// <returns>The port in the mapData for the given id.</returns>
 public IPort GetPortById(long portId)
 {
     foreach (IPort port in ports)
     {
         MapPort mapPort = (MapPort)port;
         if (mapPort.Id == portId)
         {
             return(mapPort);
         }
     }
     return(null);
 }
예제 #2
0
파일: MapLink.cs 프로젝트: kurtrips/tc
 /**
  * Convenience method to remove the first occurence of the MapPort from the ports list. Null parameters are not allowed.
  * If the list is null, just return false.
  *
  *
  * @return True if removed. False otherwise
  * @param port The MapPort to remove from the ports list
  * @throws ArgumentNullException If port is null
  */
 public bool RemovePort(MapPort port)
 {
     return(ports.Remove(port));
 }
예제 #3
0
파일: MapLink.cs 프로젝트: kurtrips/tc
 /**
  * Convenience method to add a MapPort to the ports list. Null parameters are not allowed.
  * If the list is null, just create a new instance and add to it.
  *
  *
  * @param port The MapPort to add to the ports list
  * @throws ArgumentNullException If port is null
  */
 public void AddPort(MapPort port)
 {
     ports.Add(port);
 }