Beispiel #1
0
 /// <summary>
 /// creates a team based on the arguments, only works if there is a team name and a team image.
 /// The team image cannot be the same as one already existing, currently.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SubmitTeam_Click(object sender, RoutedEventArgs e)
 {
     if (TeamNameTextBox.Text == "" || NewTeamImage.GetValue(Image.SourceProperty) == null)
     {
         MessageBoxResult result = MessageBox.Show("remember to insert a name and select an image");
     }
     else
     {
         string teamName = TeamNameTextBox.Text;
         tImpl.AddAllyTeam(teamName, TeamImageName);
         TeamNameTextBox.Clear();
         NewTeamImage.ClearValue(Image.SourceProperty); //clears the image
         TeamNameChoice.Items.Add(teamName);
         CreateTeamBox.Visibility        = Visibility.Hidden;
         CoverTeamCanvasImage.Visibility = Visibility.Visible;
     }
 }
Beispiel #2
0
        private void AddGame_Button_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(NameTextBox.Text))
            {
                MessageBox.Show("Game Name Required", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else if (String.IsNullOrEmpty(exeTextBlock.Text))
            {
                MessageBox.Show("Game .exe File Path Required", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else if (String.IsNullOrEmpty(VideoTextBlock.Text))
            {
                MessageBox.Show("Game Video File Path Required", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            //else if (String.IsNullOrEmpty(LogoTextBlock.Text))
            //{
            //    MessageBox.Show("Game Logo File Path Required", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            //}
            else
            {
                string teamMembers = "";
                for (int i = 0; i < TeamMemberList.Count; i++)
                {
                    if (i != TeamMemberList.Count - 1)
                    {
                        teamMembers += TeamMemberList[i].Name;
                        teamMembers += ",";
                        teamMembers += TeamMemberList[i].Email;
                        teamMembers += ";";
                    }
                    else
                    {
                        teamMembers += TeamMemberList[i].Name;
                        teamMembers += ",";
                        teamMembers += TeamMemberList[i].Email;
                    }
                }

                Game g = new Game
                {
                    Name       = NameTextBox.Text,
                    TeamName   = TeamNameTextBox.Text,
                    StudioName = StudioNameTextBox.Text,
                    ExePath    = exeTextBlock.Text,
                    VideoPath  = VideoTextBlock.Text,
                    //LogoPath = LogoTextBlock.Text,
                    Blurb       = BlurbTextBlock.Text,
                    Engine      = EngineComboBox.Text,
                    Genre       = GenreComboBox.Text,
                    Setting     = SettingComboBox.Text,
                    Rendering   = RenderingComboBox.Text,
                    Competition = CompetitionComboBox.Text,
                    Physics     = PhysicsComboBox.Text,
                    Sound       = SoundComboBox.Text,
                    Input       = InputComboBox.Text,
                    Players     = PlayersComboBox.Text,
                    TeamMembers = teamMembers
                };

                GameList.Add(g);

                NameTextBox.Clear();
                TeamNameTextBox.Clear();
                StudioNameTextBox.Clear();
                exeTextBlock.Text   = string.Empty;
                VideoTextBlock.Text = string.Empty;
                //LogoTextBlock.Text = string.Empty;
                BlurbTextBlock.Clear();
                TeamMemberList.Clear();
                TMListView.ItemsSource = null;

                SaveList();
            }
        }