Exemple #1
0
 /// <summary>
 /// Gets the link with given id
 /// </summary>
 /// <param name="linkId">The id</param>
 /// <returns>The link with given id or null if no such id is present</returns>
 public ILink GetLinkById(long linkId)
 {
     foreach (ILink link in links)
     {
         MapLink mapLink = (MapLink)link;
         if (mapLink.Id == linkId)
         {
             return(mapLink);
         }
     }
     return(null);
 }
Exemple #2
0
 /**
  * Convenience method to remove the first occurence of the MapLink from the links list. Null parameters are not allowed.
  * If the list is null, just return false.
  *
  *
  * @return True if removed. False otherwise
  * @param link The MapLink to remove from the links list
  * @throws ArgumentNullException If link is null
  */
 public bool RemoveLink(MapLink link)
 {
     return(links.Remove(link));
 }
Exemple #3
0
 /**
  * Convenience method to add a MapLink to the links list. Null parameters are not allowed.
  * If the list is null, just create a new instance and add to it.
  *
  *
  * @param link The MapLink to add to the links list
  * @throws ArgumentNullException If link is null
  */
 public void AddLink(MapLink link)
 {
     links.Add(link);
 }