Beispiel #1
0
 private void UpdateView()
 {
     if (Core.ApplicationData.Instance.ActiveGeocache != null)
     {
         if (GeocachesInCollections.Contains(Core.ApplicationData.Instance.ActiveGeocache.Code))
         {
             SelectedGeocacheCode = Core.ApplicationData.Instance.ActiveGeocache.Code;
         }
     }
 }
Beispiel #2
0
 private void Button_Click_4(object sender, RoutedEventArgs e)
 {
     if (SelectedCollection != null && Core.ApplicationData.Instance.ActiveGeocache != null)
     {
         int id = Core.Settings.Default.GetCollectionID(SelectedCollection);
         if (id >= 0)
         {
             if (!Core.Settings.Default.InCollection(id, Core.ApplicationData.Instance.ActiveGeocache.Code))
             {
                 Core.Settings.Default.AddToCollection(id, Core.ApplicationData.Instance.ActiveGeocache.Code);
                 GeocachesInCollections.Add(Core.ApplicationData.Instance.ActiveGeocache.Code);
                 SelectedGeocacheCode = Core.ApplicationData.Instance.ActiveGeocache.Code;
             }
         }
     }
 }
Beispiel #3
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (SelectedCollection != null)
     {
         int id = Core.Settings.Default.GetCollectionID(SelectedCollection);
         if (id >= 0)
         {
             List <string> sl = new List <string>();
             foreach (string s in gcInCollection.SelectedItems)
             {
                 sl.Add(s);
             }
             foreach (string s in sl)
             {
                 Core.Settings.Default.RemoveFromCollection(id, s);
                 GeocachesInCollections.Remove(s);
             }
         }
     }
 }
Beispiel #4
0
 private void Button_Click_5(object sender, RoutedEventArgs e)
 {
     if (SelectedCollection != null && Core.ApplicationData.Instance.ActiveDatabase != null)
     {
         int id = Core.Settings.Default.GetCollectionID(SelectedCollection);
         if (id >= 0)
         {
             foreach (var g in Core.ApplicationData.Instance.ActiveDatabase.GeocacheCollection)
             {
                 if (g.Selected)
                 {
                     if (!Core.Settings.Default.InCollection(id, g.Code))
                     {
                         Core.Settings.Default.AddToCollection(id, g.Code);
                         GeocachesInCollections.Add(g.Code);
                     }
                 }
             }
         }
     }
 }