public void decrementMarker(HoldingMarker marker) { if (marker.duetNumber == 0) { if (marker.setNumber == 0) { if (marker.groupNumber == 0) { MessageBox.Show("Кажется, более ранних групп не существует"); } else { marker.groupNumber -= 1; marker.setNumber = tourList[currentMark.tourNumber].groupList[marker.groupNumber].SetListInTour.Count - 1; marker.duetNumber = tourList[currentMark.tourNumber].groupList[marker.groupNumber].SetListInTour[marker.setNumber].DuetListInTour.Count - 1; } } else { marker.setNumber -= 1; marker.duetNumber = tourList[currentMark.tourNumber].groupList[marker.groupNumber].SetListInTour[marker.setNumber].DuetListInTour.Count - 1; } } else { marker.duetNumber -= 1; } }
public void drawMarking(HoldingMarker marker) { //MessageBox.Show($"{marker.tourNumber}\n{tourList.Count - 1}"); if (marker.tourNumber >= tourList.Count - 1) { drawTournirEnding(); } else { drawGroupEnding(); } }
public void incrementMarker(HoldingMarker marker) { if (marker.duetNumber >= tourList[marker.tourNumber].groupList[marker.groupNumber].SetListInTour[marker.setNumber].DuetListInTour.Count - 1) { if (marker.setNumber >= tourList[marker.tourNumber].groupList[marker.groupNumber].SetListInTour.Count - 1) { if (marker.groupNumber >= tourList[marker.tourNumber].groupList.Count - 1) { DialogResult result = MessageBox.Show("Кажется, это крайняя группа в этом туре!\n Перейти на следующий тур?", "Системное сообщение", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { if (marker.tourNumber >= tourList.Count - 1) { result = MessageBox.Show("Вы завершили последний тур!\nЗавершить турнир?", "Системное сообщение", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { MessageBox.Show(currentMark.ToString()); drawMarking(marker); //marker.groupNumber += 1; //marker.setNumber = 0; //marker.duetNumber = 0; } } else { MessageBox.Show(currentMark.ToString()); drawMarking(marker); //marker.groupNumber += 1; //marker.setNumber = 0; //marker.duetNumber = 0; } } } else { drawMarking(marker); marker.groupNumber += 1; marker.setNumber = 0; marker.duetNumber = 0; } } else { marker.duetNumber = 0; marker.setNumber += 1; } } else { marker.duetNumber += 1; } }
public void ClrMarkerButton(HoldingMarker marker) { foreach (GroupInTour groupN in tourList[marker.tourNumber].groupList) { groupN.groupButton.BackColor = Color.Empty;; foreach (SetInTour setN in groupN.SetListInTour) { setN.setButton.BackColor = Color.Empty; foreach (DuetInTour duetN in setN.DuetListInTour) { duetN.duetButton.BackColor = Color.Empty; } } } }
public tournirResultComboBox(HoldingMarker mark, ComboBox comBox) { this.marker = mark; this.valueComboBox = comBox; }
public tournirResultComboBox(HoldingMarker mark) { this.marker = mark; }
public void ClrAndMarkerIt(HoldingMarker marker) { ClrMarkerButton(marker); GoToMarkeredButton(marker); }
//public void AddingDuets(TournirClass ourTournir) //{ // for (int j = 0; j < ourTournir.groups.Count; j++) // foreach (SetClass item in ourTournir.groups[j].SetList) // { // for (int i = 0; i < rnd.Next() % 5 + 1; i++) // { // item.DuetList.Add(new Duet(i)); // } // } //} public void GoToMarkeredButton(HoldingMarker marker) { tourList[marker.tourNumber].groupList[marker.groupNumber].groupButton.BackColor = Color.Turquoise; tourList[marker.tourNumber].groupList[marker.groupNumber].SetListInTour[marker.setNumber].setButton.BackColor = Color.Turquoise; tourList[marker.tourNumber].groupList[marker.groupNumber].SetListInTour[marker.setNumber].DuetListInTour[marker.duetNumber].duetButton.BackColor = Color.Turquoise; }
private void startButton_Click(object sender, EventArgs e) { timeOfStart = DateTime.Now; timelabel.Text = Convert.ToString(timeOfStart.ToShortTimeString()); timer1.Start(); Panel ControlPanel = new Panel() { Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom))), //Dock = System.Windows.Forms.DockStyle.Fill, Size = new Size(885, 451) }; Button TourOneButton = new Button() { Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom))), //Dock = System.Windows.Forms.DockStyle.Fill }; foreach (Tour item in tourList) { item.controlTourPanel.Controls.Clear(); } foreach (Button btn in tourButtonList) { Controls.RemoveByKey(btn.Name); } tourButtonList.Clear(); RemoveEmptyGroupsFromForm(); currentMark = new HoldingMarker(0, 0, 0, 0); int countOfTour = (int)countOfTourNumericUpDown.Value; pushStartLabel.Visible = false; for (int i = 0; i < countOfTour; i++) { Controls.Add(ControlPanel = new Panel() { Name = "ControlPanel" + i, Location = new Point(25, 78), Size = new Size(670, 300), BorderStyle = BorderStyle.FixedSingle, AutoScroll = true, Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom))) }); if (i == countOfTour - 1) { Controls.Add(TourOneButton = new Button() { Name = "TourButton" + i, Location = new Point(25 + i * 500 / countOfTour, 45), Size = new Size(500 / countOfTour, 35), Text = "Финал", Font = new Font("", 12), TextAlign = ContentAlignment.MiddleLeft, Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))) }); } else { Controls.Add(TourOneButton = new Button() { Name = "TourButton" + i, Location = new Point(25 + i * 500 / countOfTour, 45), Size = new Size(500 / countOfTour, 35), Text = "Тур 1/" + (Math.Pow(2, countOfTour - (i + 1))), Font = new Font("", 12), TextAlign = ContentAlignment.MiddleLeft, //Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))) }); } tourButtonList.Add(TourOneButton); tourList.Add(new Tour(i, ControlPanel, TourOneButton)); tourList[i].tourButton.Click += TourButtonsEvent; drawTourInfo(tourList[i]); } tourButtonList[0].PerformClick(); }
public void drawTournirEnding() { ComboBox comboBoxOfJudge = new ComboBox(); ControlPanel.Controls.Clear(); ControlPanel.Visible = true; buttonPanel.Visible = true; List <int> positionsInComboBoxList = new List <int>(); int height = 0; int weidh = 0; height += 45; weidh += 30; for (int i = 0; i < this.tournir.judges.Count; i++) { //ControlPanel.Controls.Add(new Label() { Text = Convert.ToString((char)(65 + i)), Location = new Point(45 + 470 / this.tournir.judges.Count * i, 15), Font = new Font("", 12)}); ControlPanel.Controls.Add(new Label() { Text = Convert.ToString((char)(65 + i)), Location = new Point(105 + 80 * i, 15), Size = new Size(30, 25), Font = new Font("", 12) }); } int j = 0; foreach (SetInTour setItem in tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour) { ControlPanel.Controls.Add(new Label() { Text = "Заход" + Convert.ToString(setItem.number + 1), Location = new Point(5, height), Size = new Size(100, 25), Font = new Font("", 12), //Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))), //Dock = DockStyle.Fill }); height += 30; foreach (DuetInTour duetItem in setItem.DuetListInTour) { ControlPanel.Controls.Add(new Label() { Text = "Пара" + Convert.ToString(duetItem.number + 1), Location = new Point(10, height), Size = new Size(90, 25), Font = new Font("", 12), //Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))), //Dock = DockStyle.Fill }); HoldingMarker markerForCheckList = new HoldingMarker(currentMark.tourNumber, currentMark.groupNumber, tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem), tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour[tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem)].DuetListInTour.IndexOf(duetItem)); for (int i = 0; i < this.tournir.judges.Count; i++) { ControlPanel.Controls.Add(comboBoxOfJudge = new ComboBox() { Location = new Point(105 + 80 * i, height), Size = new Size(45, 33), Font = new Font("", 12) }); for (int g = 0; g < countsOfPositionsNumericUpDown.Value; g++) { comboBoxOfJudge.Items.Add(g + 1); } comboBoxOfJudge.BringToFront(); tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].resultOfGroup_list.Add(new tournirResultComboBox(markerForCheckList, comboBoxOfJudge)); tourList[currentMark.tourNumber].resultOfTournir_list.Add(new tournirResultComboBox(markerForCheckList, comboBoxOfJudge)); } height += 30; j++; } //string retstr = ""; //foreach (tournirResultComboBox combItem in tourList[currentMark.tourNumber].resultOfTournir_list) // retstr += combItem.ToString(); } //for (int i = 0; i < this.tournir.judges.Count; i++) //{ // ControlPanel.Controls.Add(new Label() { Text = Convert.ToString((char)(65 + i)), Location = new Point(45 + 470 / this.tournir.judges.Count * i, 15), Font = new Font("", 12) }); //} //int j = 0; //foreach (SetInTour setItem in tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour) //{ // foreach (DuetInTour duetItem in setItem.DuetListInTour) // { // ControlPanel.Controls.Add(new Label() { Text = Convert.ToString(duetItem.number + 1), Location = new Point(10, 45 + 300 / this.tournir.judges.Count * j), Font = new Font("", 12) }); // HoldingMarker markerForCheckList = new HoldingMarker(currentMark.tourNumber, currentMark.groupNumber, // tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem), // tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour[tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem)].DuetListInTour.IndexOf(duetItem)); // for (int i = 0; i < this.tournir.judges.Count; i++) // { // ControlPanel.Controls.Add(comboBoxOfJudge = new ComboBox() { Location = new Point(45 + 470 / this.tournir.judges.Count * i, 45 + 300 / this.tournir.judges.Count * j), Size = new Size(45, 45), Font = new Font("", 12) }); // comboBoxOfJudge.BringToFront(); // ComboBoxForEndingTour combokBoxForDuet = new ComboBoxForEndingTour(markerForCheckList, comboBoxOfJudge); // tourList[currentMark.tourNumber].resultOfTournir_list.Add(comboBoxOfJudge); // } // j++; // } //} }
public void drawGroupEnding() { CheckBox checkBoxOfJudge = new CheckBox(); ControlPanel.Controls.Clear(); tourList[currentMark.tourNumber].result_list.Clear(); ControlPanel.Visible = true; buttonPanel.Visible = true; int height = 45; //int weidh = 30; for (int i = 0; i < this.tournir.judges.Count; i++) { //ControlPanel.Controls.Add(new Label() { Text = Convert.ToString((char)(65 + i)), Location = new Point(45 + 470 / this.tournir.judges.Count * i, 15), Font = new Font("", 12)}); ControlPanel.Controls.Add(new Label() { Text = Convert.ToString((char)(65 + i)), Location = new Point(105 + 60 * i, 15), Size = new Size(30, 25), Font = new Font("", 12) }); } int j = 0; foreach (SetInTour setItem in tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour) { ControlPanel.Controls.Add(new Label() { Text = "Заход" + Convert.ToString(setItem.number + 1), Location = new Point(5, height), Size = new Size(100, 25), Font = new Font("", 12) }); height += 30; foreach (DuetInTour duetItem in setItem.DuetListInTour) { //ControlPanel.Controls.Add(new Label() { Text = Convert.ToString(duetItem.number + 1), Location = new Point(10, 45 + 300 / this.tournir.judges.Count * j), Font = new Font("", 12) }); ControlPanel.Controls.Add(new Label() { Text = "Пара" + Convert.ToString(duetItem.number + 1), Location = new Point(10, height), Size = new Size(90, 25), Font = new Font("", 12) }); HoldingMarker markerForCheckList = new HoldingMarker(currentMark.tourNumber, currentMark.groupNumber, tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem), tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour[tourList[currentMark.tourNumber].groupList[currentMark.groupNumber].SetListInTour.IndexOf(setItem)].DuetListInTour.IndexOf(duetItem)); for (int i = 0; i < this.tournir.judges.Count; i++) { //ControlPanel.Controls.Add(checkBoxOfJudge = new CheckBox() {Location = new Point(45 + 470 / this.tournir.judges.Count * i, 45 + 300 / this.tournir.judges.Count * j), Font = new Font("", 12) }); //ControlPanel.Controls.Add(checkBoxOfJudge = new CheckBox() {Location = new Point(45 + 470 / this.tournir.judges.Count * i, height), Font = new Font("", 12) }); ControlPanel.Controls.Add(checkBoxOfJudge = new CheckBox() { Location = new Point(105 + 60 * i, height), Size = new Size(20, 20), Font = new Font("", 12) }); //height += 25; checkBoxOfJudge.BringToFront(); CheckBoxForDuets checkBoxForDuet = new CheckBoxForDuets(markerForCheckList, checkBoxOfJudge); tourList[currentMark.tourNumber].result_list.Add(checkBoxForDuet); } height += 30; j++; } } }
public ComboBoxForEndingTour(HoldingMarker marker, ComboBox comBox) { this.marker = marker; this.markComboBox = comBox; this.mark = 0; }
public ComboBoxForEndingTour(HoldingMarker marker) { this.marker = marker; this.mark = 0; }
public CheckBoxForDuets(HoldingMarker mark, CheckBox cheBox) { this.marker = mark; this.validnessCheckBox = cheBox; }
public CheckBoxForDuets(HoldingMarker mark) { this.marker = mark; }