public void AutoGenerateChildren(MatchCollection matches) { int count = 0; m_App.CacheStore.StartUpdate(); foreach (Match match in matches) { DegreeMinutes[] coord = Utilities.ParseCoordString(match.Captures[0].Value); System.Console.WriteLine(Utilities.getCoordString(coord[0], coord[1])); Waypoint newPoint = new Waypoint(); Geocache parent = m_Cache; newPoint.Symbol = "Reference Point"; newPoint.Parent = parent.Name; newPoint.Lat = coord[0].GetDecimalDegrees(); newPoint.Lon = coord[1].GetDecimalDegrees(); newPoint.Desc = Catalog.GetString("Grabbed Waypoint"); String name = "RP" + parent.Name.Substring(2); if (m_App.AppConfig.IgnoreWaypointPrefixes) { name = parent.Name; } name = m_App.CacheStore.GetUniqueName(name); newPoint.Name = name; m_App.CacheStore.AddWaypointOrCache(newPoint, false, false); count++; } m_App.CacheStore.CompleteUpdate(); m_App.RefreshAll(); }
void HandleM_viewNavigationRequested(object o, WebKit.NavigationRequestedArgs args) { if (contentLoaded) { m_view.StopLoading(); if (args.Request.Uri.StartsWith("ocm://")) { string[] request = args.Request.Uri.Substring(6).Split('/'); if (request[0].Equals("deleteLog")) { MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, Mono.Unix.Catalog.GetString("Are you sure you wish to delete this log?")); if (((int)ResponseType.Yes) == dlg.Run()) { dlg.Hide(); m_App.CacheStore.PurgeLogsByKey(new String[] { request[1] }); m_App.RefreshAll(); } dlg.Hide(); } else if (request[0].Equals("editLog")) { OfflineLogDialog dlg = new OfflineLogDialog(); dlg.MainWin = m_Win; dlg.useFullLog = true; ocmengine.CacheLog log = m_App.CacheStore.GetCacheLogByKey(request[1]); dlg.Log = log; if ((int)ResponseType.Ok == dlg.Run()) { log = dlg.Log; m_App.CacheStore.AddLog(log.CacheCode, log); dlg.Hide(); m_App.RefreshAll(); } dlg.Hide(); } } else { // System.Diagnostics.Process.Start(args.Request.Uri); Helper.ProcessStartURL(args.Request.Uri); } } }
public void NextMatch() { m_pos++; if (m_pos == m_matches.Count) { this.Hide(); m_App.RefreshAll(); return; } reviewWidget.WaypointMatch = m_matches[m_pos]; this.Title = String.Format(Catalog.GetString("Reviewing Waypoint {0} of {1}"), m_pos + 1, m_matches.Count); }