private static List<DarwinServiceLocation> createDarwinServiceLocationArray(ServiceLocation[] serviceLocation)
 {
     List<DarwinServiceLocation> result = new List<DarwinServiceLocation>();
     if (serviceLocation == null)
         return result;
     foreach (ServiceLocation location in serviceLocation)
     {
         DarwinServiceLocation toAdd = new DarwinServiceLocation(
             location.locationName, location.crs, location.via, location.futureChangeTo, location.assocIsCancelled);
         result.Add(toAdd);
     }
     return result;
 }
        private static List <DarwinServiceLocation> createDarwinServiceLocationArray(ServiceLocation[] serviceLocation)
        {
            List <DarwinServiceLocation> result = new List <DarwinServiceLocation>();

            if (serviceLocation == null)
            {
                return(result);
            }
            foreach (ServiceLocation location in serviceLocation)
            {
                DarwinServiceLocation toAdd = new DarwinServiceLocation(
                    location.locationName, location.crs, location.via, location.futureChangeTo, location.assocIsCancelled);
                result.Add(toAdd);
            }
            return(result);
        }
 protected static string buildDestination(DarwinServiceLocation[] darwinServiceLocations, DarwinServiceLocation[] singularLocation)
 {
     StringBuilder result = new StringBuilder();
     if ((singularLocation == null) && (darwinServiceLocations == null)) return string.Empty;
     foreach (DarwinServiceLocation location in singularLocation)
     {
         result.Append(location.LocationName + " ");
         if (!string.IsNullOrEmpty(location.Via))
         {
             result.Append(location.Via.Trim() + " ");
         }
     }
     if (darwinServiceLocations.GetLength(0) > 0)
     {
         foreach (DarwinServiceLocation location in darwinServiceLocations)
         {
             result.Append(location.LocationName + " ");
             if (!string.IsNullOrEmpty(location.Via))
             {
                 result.Append(location.Via + " ");
             }
         }
     }
     if(result.Length>0)
         result.Length--;//remove the last space;
     return result.ToString();
 }