/// <summary> /// removes all tracks having this source /// </summary> /// <param name="name"></param> public static void RemoveTracksBySource(string source) { if (source == null || source.Length == 0) { return; } again: for (int i = 0; i < m_tracksAll.Count; i++) { Track trk = (Track)m_tracksAll[i]; try { if (source.Equals(trk.Source)) { PhotoWaypoints.RemoveWaypointsByTrackId(trk.Id); m_tracksAll.RemoveAt(i); isDirty = true; goto again; } } catch (Exception e) { } } RefreshWaypointsDisplayed(); }
public static void RemoveWaypointsBySource(string source) { lock (m_waypointsAll) { again: for (int i = 0; i < m_tracksAll.Count; i++) { Track trk = (Track)m_tracksAll[i]; try { if (trk.Source.Equals(source)) { m_tracksAll.RemoveAt(i); isDirty = true; goto again; } } catch (Exception e) { } } again2: for (int i = 0; i < m_waypointsAll.Count; i++) { Waypoint wp = (Waypoint)m_waypointsAll[i]; try { if (wp.Source.Equals(source)) { m_waypointsAll.RemoveAt(i); isDirty = true; goto again2; } } catch (Exception e) { } } } PhotoWaypoints.RemoveWaypointsBySource(source); RefreshWaypointsDisplayed(); }
public static void RemoveTrackById(long trackId) { for (int i = 0; i < m_tracksAll.Count; i++) { Track trk = (Track)m_tracksAll[i]; try { if (trk.Id == trackId) { PhotoWaypoints.RemoveWaypointsByTrackId(trackId); m_tracksAll.RemoveAt(i); isDirty = true; break; // can't be duplicate track Ids } } catch (Exception e) { } } RefreshWaypointsDisplayed(); }