public void EditChildWaypoint(Waypoint pt) { Geocache parent = m_Window.CacheList.SelectedCache; WaypointDialog dlg = new WaypointDialog(); string origname = pt.Name; dlg.App = this; dlg.IgnorePrefix = m_Config.IgnoreWaypointPrefixes; dlg.SetPoint(pt); if ((int)ResponseType.Ok == dlg.Run()) { pt = dlg.GetPoint(); if (pt.Symbol == "Final Location") { parent.HasFinal = true; } if (!parent.Children) { parent.Children = true; } m_Store.AddWaypointOrCache(pt, false, false); if (pt.Name != origname) { m_Store.DeleteWaypoint(origname); } m_Window.Refresh(); m_Window.CacheInfo.SelectChildByName(pt.Name); } dlg.Hide(); }
public void AddChildWaypoint(double lat, double lon) { Waypoint newPoint = new Waypoint(); Geocache parent = m_Window.CacheList.SelectedCache; newPoint.Symbol = "Final Location"; newPoint.Parent = parent.Name; newPoint.Lat = lat; newPoint.Lon = lon; String name = "FL" + parent.Name.Substring(2); WaypointDialog dlg = new WaypointDialog(); dlg.IgnorePrefix = m_Config.IgnoreWaypointPrefixes; dlg.App = this; if (m_Config.IgnoreWaypointPrefixes) { name = parent.Name; dlg.IgnorePrefix = true; } name = m_Store.GetUniqueName(name); newPoint.Name = name; dlg.SetPoint(newPoint); if ((int)ResponseType.Ok == dlg.Run()) { newPoint = dlg.GetPoint(); if (newPoint.Symbol == "Final Location") { parent.HasFinal = true; } if (!parent.Children) { parent.Children = true; } m_Store.AddWaypointOrCache(newPoint, false, false); m_Window.Refresh(); m_Window.CacheInfo.SelectChildByName(newPoint.Name); } dlg.Hide(); }
public void EditChildWaypoint(Waypoint pt) { Geocache parent = m_Window.CacheList.SelectedCache; WaypointDialog dlg = new WaypointDialog (); string origname = pt.Name; dlg.App = this; dlg.IgnorePrefix = m_Config.IgnoreWaypointPrefixes; dlg.SetPoint (pt); if ((int)ResponseType.Ok == dlg.Run ()) { pt = dlg.GetPoint (); if (pt.Symbol == "Final Location") parent.HasFinal = true; if (!parent.Children) parent.Children = true; m_Store.AddWaypointOrCache (pt, false, false); if (pt.Name != origname) m_Store.DeleteWaypoint(origname); m_Window.Refresh(); m_Window.CacheInfo.SelectChildByName(pt.Name); } dlg.Hide(); }
public void AddChildWaypoint(double lat, double lon) { Waypoint newPoint = new Waypoint (); Geocache parent = m_Window.CacheList.SelectedCache; newPoint.Symbol = "Final Location"; newPoint.Parent = parent.Name; newPoint.Lat = lat; newPoint.Lon = lon; String name = "FL" + parent.Name.Substring (2); WaypointDialog dlg = new WaypointDialog (); dlg.IgnorePrefix = m_Config.IgnoreWaypointPrefixes; dlg.App = this; if (m_Config.IgnoreWaypointPrefixes) { name = parent.Name; dlg.IgnorePrefix = true; } name = m_Store.GetUniqueName(name); newPoint.Name = name; dlg.SetPoint (newPoint); if ((int)ResponseType.Ok == dlg.Run ()) { newPoint = dlg.GetPoint (); if (newPoint.Symbol == "Final Location") parent.HasFinal = true; if (!parent.Children) parent.Children = true; m_Store.AddWaypointOrCache (newPoint, false, false); m_Window.Refresh(); m_Window.CacheInfo.SelectChildByName(newPoint.Name); } dlg.Hide(); }