public void GrabWaypoints() { String expr = @"\b[NnSs] ?[0-9]+.? ?[0-9]*\.[0-9]*\s[WwEe] ?[0-9]+.? ?[0-9]*\.[0-9]*"; String desc = m_Cache.ShortDesc + m_Cache.LongDesc; MatchCollection matches = Regex.Matches(desc, expr); if (matches.Count > 0) { ScanWaypointsDialog dlg = new ScanWaypointsDialog(matches.Count, this, matches); dlg.Run(); } else { MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, Catalog.GetString("OCM was unable to find any child waypoints.")); dlg.Run(); dlg.Hide(); } }
public void GrabWaypoints() { Geocache cache = m_mon.SelectedCache; String expr = @"\b[NnSs] ?[0-9]+.? ?[0-9]*\.[0-9]*\s[WwEe] ?[0-9]+.? ?[0-9]*\.[0-9]*"; String desc = cache.ShortDesc + cache.LongDesc; MatchCollection matches = Regex.Matches(desc, expr); m_mon.StartProgressLoad(Catalog.GetString("Grabbing Waypoints"), false); if (matches.Count > 0) { ScanWaypointsDialog dlg = new ScanWaypointsDialog(matches.Count, this, matches); dlg.Run(); } else { MessageDialog dlg = new MessageDialog(m_mon.Main, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, Catalog.GetString("OCM was unable to find any child waypoints.")); dlg.Run(); dlg.Hide(); } m_mon.SetProgressDone(false); }