Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
 public abstract void AddTravelBug(string parent, TravelBug bug);
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public abstract void AddTravelBug(string parent, TravelBug bug);
Ejemplo n.º 5
0
 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();
         }
     }
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
 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;
 }