示例#1
0
 public void AddLocation(Location loc)
 {
     if (m_locations.ContainsKey(loc.Name))
     {
         m_locations.Remove(loc.Name);
     }
     m_locations.Add(loc.Name, loc);
     UpdateLocFile();
 }
 public void AddLocation(Location loc)
 {
     if (m_locations.ContainsKey(loc.Name))
     {
         MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo,
                                               String.Format(Catalog.GetString("Are you sure you wish to " +
                                               	"overwrite \"{0}\"?"), loc.Name));
         if ((int) ResponseType.Yes != dlg.Run())
         {
             dlg.Hide();
             return;
         }
         else
         {
             dlg.Hide();
             m_locations.Remove(loc.Name);
         }
     }
     m_locations.Add(loc.Name, loc);
     UpdateLocFile();
 }
示例#3
0
 public bool Contains(Location loc)
 {
     return m_locations.ContainsKey(loc.Name);
 }
 public void SetLocation(Location loc)
 {
     SetLocation(loc.Name, loc.Latitude, loc.Longitude);
 }