Пример #1
0
 public void clearForImport(FileStream fs, CacheStore store)
 {
     XmlReader rdr = XmlReader.Create(fs);
     rdr.Settings.IgnoreWhitespace = true;
     List<String> waypoints = new List<String>();
     while (rdr.Read())
     {
         if (rdr.LocalName == "name" && rdr.IsStartElement())
         {
             waypoints.Add(CacheStore.SQLEscape(rdr.ReadElementContentAsString()));
         }
     }
     rdr.Close();
     store.ClearTBs(waypoints);
     if (m_purgeLogs)
         store.ClearLogs(waypoints);
     store.ClearAttributes(waypoints);
     return;
 }
Пример #2
0
 public int PreParseForSingle(FileStream fs, CacheStore store)
 {
     XmlReader rdr = XmlReader.Create(fs);
     rdr.Settings.IgnoreWhitespace = true;
     int count = 0;
     List<String> waypoints = new List<String>();
     while (rdr.Read())
     {
         if (rdr.Name == "wpt" && rdr.IsStartElement())
         {
             count++;
         }
         else if (rdr.Name == "waypoint" && rdr.IsStartElement())
         {
             count++;
         }
         else if (rdr.LocalName == "name" && rdr.IsStartElement())
         {
             waypoints.Add(CacheStore.SQLEscape(rdr.ReadElementContentAsString()));
         }
     }
     rdr.Close();
     store.ClearTBs(waypoints);
     if (m_purgeLogs)
         store.ClearLogs(waypoints);
     store.ClearAttributes(waypoints);
     return count;
 }