private void parseTravelBug(ref Geocache cache, XmlReader reader) { TravelBug bug = new TravelBug(); bug.ID = reader.GetAttribute("id"); bug.Ref = reader.GetAttribute("ref"); while (reader.Read()) { if (reader.LocalName == "travelbug") { m_store.AddTravelBug(cache.Name, bug); return; } if (reader.LocalName == "name") { bug.Name = reader.ReadElementContentAsString(); } } }
public abstract void AddTravelBug(string parent, TravelBug bug);
public void SetTravelBugs(TravelBug[] bugs) { tbStore.Clear (); foreach (TravelBug bug in bugs) { tbStore.AppendValues (bug); } if (bugs.Length == 0) tbugExpander.Sensitive = false; else tbugExpander.Sensitive = true; }
private void parseTravelBug(ref Geocache cache, XmlReader reader) { TravelBug bug = new TravelBug(); bug.ID = reader.GetAttribute("id"); bug.Ref = reader.GetAttribute("ref"); while (reader.Read()) { if (reader.LocalName == "travelbug") { m_store.AddTB(cache.Name, bug); return; } if (reader.LocalName == "name") { bug.Name = reader.ReadElementContentAsString(); } } }
public List<TravelBug> GetTravelBugs(String cachename) { List<TravelBug> bugs = new List<TravelBug>(); IDbConnection conn = OpenConnection(); IDbCommand cmd = conn.CreateCommand(); cmd.CommandText = String.Format(GET_TB, cachename); IDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { TravelBug bug = new TravelBug(); bug.ID = rdr.GetString(0); bug.Ref = rdr.GetString(1); bug.Name = rdr.GetString(2); bug.Cache = cachename; bugs.Add(bug); } CloseConnection(ref rdr, ref cmd, ref conn); return bugs; }
public void AddTB(String cachename, TravelBug bug) { IDbCommand cmd = m_conn.CreateCommand(); cmd.CommandText = String.Format(ADD_TB, cachename, bug.ID, bug.Ref, SQLEscape(bug.Name)); cmd.ExecuteNonQuery(); cmd.Dispose(); cmd = null; }