private void Button_Click(object sender, RoutedEventArgs e) { if (!ValidInput()) { return; } var game = new Game(int.Parse(TeamNumber.Text)) { GameNumber = int.Parse(GameNumber.Text), AutonomousDescription = GetContentOfAutoDescription(), AutonomousSuccess = AutoSucsses.GetIntValue(), Climb = Climb.IsChecked != null && (bool)Climb.IsChecked, MiddleAutonomous = MiddleAuto.IsChecked != null && (bool)MiddleAuto.IsChecked, MissionSuccess = MissionSucssesSlider.GetIntValue(), Missions = GetSelectedMission(), Stability = StabilitySlider.GetIntValue() }; MsgLabel.Visibility = Visibility.Visible; if (!DataLists.AddGame(game)) { MsgLabel.ShowMessage("Can't send game to server.\nPlease check your internet connection.", true); } else { MsgLabel.ShowMessage("Game has successfully saved!", false); } }
private void DetailsButtonOnClick(object sender, RoutedEventArgs e) { MsgLabel.Visibility = Visibility.Collapsed; CustomListViewColumn column = (CustomListViewColumn)sender; int idx = CustomListView.ItemList.Children.IndexOf(column); Game game = DataLists.GetGames()[idx]; GameDetailsExpender.IsExpanded = true; GameDetails.ShowDetails(game); }
private void UpdateList() { MsgLabel.Visibility = Visibility.Visible; (string msg, bool err) = DataLists.UpdateGameList(); MsgLabel.ShowMessage(msg, err); CustomListView.ItemList.Children.Clear(); foreach (var game in DataLists.GetGames()) { CustomListViewColumn column = new CustomListViewColumn { Data1 = { Content = game.TeamNumber }, Data2 = { Content = game.GameNumber } }; column.MouseDoubleClick += DetailsButtonOnClick; CustomListView.ItemList.Children.Add(column); } }
private void Submit_OnClick(object sender, RoutedEventArgs e) { Settings.Password = PasswordBox.Password; if (!Connections.ValidPassword()) { MsgLabel.Visibility = Visibility.Visible; MsgLabel.ShowMessage("Incorrect Password. Maybe you're offline...", true); return; } Settings.SaveSettings(); if (_switchWindow) { SwitchToMain(); } if (Settings.LoadAtStartUp) { DataLists.RefreshLists(); } Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { var pit = new Pit(int.Parse(TeamNumber.Text)) { AutonomousOptions = int.Parse(AutoOptions.Text), Climb = ClimbAble.IsChecked != null && (bool)ClimbAble.IsChecked, MiddleAutonomous = MiddleAuto.IsChecked != null && (bool)MiddleAuto.IsChecked, Chassis = SelectedChassis(), AutonomousDescription = AutoDescriptionContent() }; MsgLabel.Visibility = Visibility.Visible; if (!DataLists.AddPit(pit)) { MsgLabel.ShowMessage("Can't send pit to server.\nPlease check your internet connection.", true); } else { MsgLabel.ShowMessage("Pit has successfully saved!", false); } }
private void RefreshLists_OnClick(object sender, RoutedEventArgs e) { DataLists.RefreshLists(); }