Пример #1
0
        private void OK_Click(object sender, RoutedEventArgs e)
        {
            User u;

            if (!UN_Field_SW.Text.Equals("") && !EM_Field_SW.Text.Equals("") && !PS_Field_SW.Password.Equals(""))
            {
                if ((u = model.addUser(EM_Field_SW.Text, UN_Field_SW.Text, PS_Field_SW.Password)) != null)
                {
                    MessageBox.Show("Welcome, " + UN_Field_SW.Text + "!\nHave a great time!", "Welcome", MessageBoxButton.OK);
                    MapWindow mp = new MapWindow(u);

                    doNotShow = true;
                    mp.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Username " + UN_Field_SW.Text + " already exists.\nPlease choose different username", "Sign In Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show("Please check if you filled in all information.", "Sign In Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #2
0
 public Map()
 {
     landmarks       = new Dictionary <string, Landmark>();
     landmarkTypes   = new Dictionary <string, LandmarkType>();
     tags            = new Dictionary <string, Tag>();
     PlacedLandmarks = new List <Landmark>();
     mw = null;
 }
 private void LogIn_Click(object sender, RoutedEventArgs e)
 {
     if (model.checkLoginData(UN_Field_LW.Text, PS_Field_LW.Password))
     {
         User      u  = model.getUser(UN_Field_LW.Text);
         MapWindow mp = new MapWindow(u);
         doNotShow = true;
         mp.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Please check your credentials.", "Log In Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }
        public LandmarkListWindow(MapWindow mw, Map m)
        {
            InitializeComponent();
            this.m   = m;
            ancestor = mw;

            AvailableLandmarks = new ObservableCollection <Landmark>();
            AllLandmarks       = new ObservableCollection <Landmark>();

            foreach (var mark in m.getLandmarks())
            {
                AvailableLandmarks.Add(mark);
                AllLandmarks.Add(mark);
            }

            this.DataContext = this;
        }
 public DefaultMap(MapWindow mw)
 {
     InitializeComponent();
     this.mw = mw;
 }
Пример #6
0
 public JavaScriptControlHelperMap(MapWindow w)
 {
     _map = w;
 }