Ejemplo n.º 1
0
        /// <summary>
        /// Execute method for AddToQueueCommand
        /// </summary>
        private void ExecuteAddToQueueCommand()
        {
            ObservableCollection <Member> temp = new ObservableCollection <Member>();

            //This condition indicates that a doubles games or singles game will occur
            if ((GetTeam1().Count == GetTeam2().Count) && GetTeam1().Count != 0)
            {
                ObservableCollection <ObservableCollection <Member> > group = new ObservableCollection <ObservableCollection <Member> >();//add both
                group.Add(GetTeam1());
                group.Add(GetTeam2());

                #region Clear the DragIn boxes in the GUI
                Player1.Clear();
                Player2.Clear();
                Player3.Clear();
                Player4.Clear();
                #endregion

                QueueList.Add(group);
                Xceed.Wpf.Toolkit.MessageBox.Show("Successfully added to queue!", "Success", MessageBoxButton.OK, MessageBoxImage.Asterisk);
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("A game must consist of either 2 or 4 players.", "Incorrect Team Size Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 2
0
 private void ButtonClear_Click(object sender, EventArgs e)
 {
     if (MessageBoxEx.Show(this, "Clear all values?", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         Player1.Clear();
         Player2.Clear();
         Player3.Clear();
         Player4.Clear();
         Player5.Clear();
         Player6.Clear();
     }
 }