Exemple #1
0
        private void OnSelectionStartChanged(int oldVal, int newValue)
        {
            string playerLine = InputParser.GetLine(newValue, Data);
            string team       = InputParser.GetTeam(newValue, Data);
            int    index      = m_TeamsComboBox.Items.IndexOf(team);

            if (index > -1)
            {
                m_TeamsComboBox.SelectedIndex = index;
            }
            string[] players = GetTeamPlayers(team);
            if (players != null)
            {
                for (int i = 0; i < players.Length; i++)
                {
                    if (players[i].StartsWith(playerLine))
                    {
                        mPlayerIndexUpDown.Value = i;
                        break;
                    }
                }
                SetCurrentPlayer();
                mInitializing = false; // keep it here, initialization failed
                this.mPlayerIndexUpDown.Maximum = players.Length - 1;
                UpdateGenericFacePictureBox();
            }
        }
Exemple #2
0
        private void DoubleClicked()
        {
            string line = InputParser.GetLine(mTextBox.SelectionStart, mTextBox.Text);

            if (!String.IsNullOrEmpty(line) && line.StartsWith("Coach", StringComparison.InvariantCultureIgnoreCase))
            {
                EditCoach();
            }
            else if (!String.IsNullOrEmpty(line) && InputParser.ParsePlayerLine(line).Count > 2)
            {
                EditPlayer();
            }
        }
Exemple #3
0
        private void OnSelectionStartChanged(int oldVal, int newValue)
        {
            string        coachLine = InputParser.GetLine(newValue, Data);
            List <string> coaches   = InputParser.GetCoaches(Data);

            if (coaches != null)
            {
                for (int i = 0; i < coaches.Count; i++)
                {
                    if (coaches[i].StartsWith(coachLine))
                    {
                        m_TeamsComboBox.SelectedIndex = i;
                        break;
                    }
                }
                mInitializing = true;
                SetCurrentCoach();
                mInitializing = false; // keep it here, initialization failed
                //this.mPlayerIndexUpDown.Maximum = coaches.Length - 1;
            }
        }