Example #1
0
        private void CrBoxSelectedIndexChanged(object sender, EventArgs e)
        {
            int j = CRBox.SelectedIndex;

            if (GTButton.Checked && j >= 0)
            {
                CPListBox.Items.Clear();
                double[] groundTouches = _comparingRps[j].Player1.GetEventTimes(LogicalEventType.GroundTouch);
                for (int i = 0; i < groundTouches.Length; i++)
                {
                    CPListBox.Items.Add("Touch " + (i + 1) + ": " + groundTouches[i].ToTimeString());
                }
                if (_comparingRps[j].Finished)
                {
                    CPListBox.Items.Add("Flower: " + _comparingRps[j].Time.ToTimeString());
                }
                if (_touchCheckPoints[j].Length > 0)
                {
                    CPListBox.ItemCheck -= CpListBoxItemCheck;
                    for (int i = 0; i < _touchCheckPoints[j].Length; i++)
                    {
                        CPListBox.SetItemChecked(_touchCheckPoints[j][i], true);
                    }
                    CPListBox.ItemCheck += CpListBoxItemCheck;
                }
            }
        }
Example #2
0
 private void CpListBoxItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (CPListBox.Items.Count > 0)
     {
         CPListBox.ItemCheck -= CpListBoxItemCheck;
         CPListBox.SetItemChecked(e.Index, e.NewValue == CheckState.Checked);
         CPListBox.ItemCheck += CpListBoxItemCheck;
         Array.Resize(ref _touchCheckPoints[CRBox.SelectedIndex], CPListBox.CheckedIndices.Count);
         for (int i = 0; i < CPListBox.CheckedIndices.Count; i++)
         {
             _touchCheckPoints[CRBox.SelectedIndex][i] = CPListBox.CheckedIndices[i];
         }
     }
 }