Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /**
  * 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));
 }
Exemple #3
0
 /**
  * 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);
 }