Exemplo n.º 1
0
        //Display GPS position
        private void ShowGPSLocations_Click(object sender, RoutedEventArgs e)
        {
            if (subWindow == null)
            {
                if (Team.getTeamList().Any() && GPSLocation.getDictionary().Any())
                {
                    subWindow = new GPSAssignment(this);
                    subWindow.Show();
                }
                else
                {
                    if (!Team.getTeamList().Any())
                    {
                        MessageBox.Show(Properties.Resources.MessageBox_GPS_NoTeams);
                    }

                    else if (!GPSLocation.getDictionary().Any())
                    {
                        MessageBox.Show(Properties.Resources.MessageBox_GPS_NoPositions);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void GPSGetDictionaryTest()
        {
            GPSLocation gps = new GPSLocation("myID3", 30.30, 30.12);

            Assert.IsTrue(GPSLocation.getDictionary().Count >= 1);
        }
Exemplo n.º 3
0
        public GPSAssignment(MainWindow caller)
        {
            this.caller            = caller;
            teamList               = Team.getTeamList();
            gpsLocationsDictionary = GPSLocation.getDictionary();
            int row = 0;

            InitializeComponent();

            foreach (Team t in teamList)
            {
                Label teamName = new Label();
                teamName.Content = t.getName();
                Grid.SetRow(teamName, row);
                Grid.SetColumn(teamName, 0);

                teamGrid.Children.Add(teamName);

                ComboBox combo   = new ComboBox();
                String   forName = row.ToString();
                //combo.Name = forName;
                Grid.SetRow(combo, row);
                Grid.SetColumn(combo, 1);

                List <TeamMember> tempList = new List <TeamMember>();
                tempList = t.getMemberList();

                volunteerList = GPSServices.getUsers();

                foreach (KeyValuePair <string, string> entry in volunteerList)
                {
                    combo.Items.Add(entry.Value);
                }

                combo.Items.Add(" ");

                teamGrid.Children.Add(combo);


                if (t.getGPSLocation() != null)
                {
                    int tempIndex = 0;

                    foreach (KeyValuePair <string, GPSLocation> entry in gpsLocationsDictionary)
                    {
                        if (entry.Value.id == t.getGPSLocation().id)
                        {
                            foreach (KeyValuePair <string, string> ID in volunteerList)
                            {
                                if (entry.Key == ID.Key)
                                {
                                    combo.SelectedIndex = tempIndex;
                                }

                                tempIndex++;
                            }
                        }
                    }
                }
                row++;
            }
        }