Beispiel #1
0
        private void saveAll()
        {
            int incomplete = 0;

            foreach (Landmark l in map.getLandmarks())
            {
                if (l.Type == null)
                {
                    incomplete++;
                }
            }

            if (incomplete > 0)
            {
                MessageBox.Show(
                    "You have some landmarks which do not have valid landmark type. \nPlease check your landmarks again.",
                    "Landmark type error", MessageBoxButton.OK, MessageBoxImage.Error);
                if (llw == null)
                {
                    llw = new LandmarkListWindow(this, map);
                }
                llw.Show();
            }
            else
            {
                currentUser.setUserMap(map);
                LoginModel.updateUser(currentUser);
                UserFileManipulation.saveUsers(LoginModel.Users);
                notSaved = false;
                MessageBox.Show("All data saved.",
                                "Save", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Beispiel #2
0
 private void LandmarkList_OnClick(object sender, RoutedEventArgs e)
 {
     if (llw == null)
     {
         llw = new LandmarkListWindow(this, currentUser.getUserMap());
         llw.Show();
     }
     else
     {
         llw.Topmost = true;  // important
         llw.Topmost = false; // important
         llw.Focus();         // important
     }
 }
 public LandmarkWindow(Map map, LandmarkListWindow lw)
 {
     InitializeComponent();
     this.map = map;
     llw      = lw;
     this.Climate_Field.Items.Add("Ice cap");
     this.Climate_Field.Items.Add("Continental");
     this.Climate_Field.Items.Add("Moderate continental");
     this.Climate_Field.Items.Add("Subtropic");
     this.Climate_Field.Items.Add("Tropic");
     this.Climate_Field.Items.Add("Desert");
     this.TouristStatus_Field.Items.Add("Exploated");
     this.TouristStatus_Field.Items.Add("Available");
     this.TouristStatus_Field.Items.Add("Not available");
     this.DataContext = this;
 }