From 29d9771333f9f996208b0e3dbce95dd80cddf8e9 Mon Sep 17 00:00:00 2001 From: Michal Zimniewicz Date: Wed, 28 Jan 2015 10:49:16 +0100 Subject: initial commit with unreleased version 1.0.4 --- Aktywator/ChooseTournament.cs | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Aktywator/ChooseTournament.cs (limited to 'Aktywator/ChooseTournament.cs') diff --git a/Aktywator/ChooseTournament.cs b/Aktywator/ChooseTournament.cs new file mode 100644 index 0000000..2bc2ded --- /dev/null +++ b/Aktywator/ChooseTournament.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Aktywator +{ + public partial class ChooseTournament : Form + { + private Tournament[] turns; + public Tournament chosenTournament; + + public ChooseTournament() + { + InitializeComponent(); + } + + private void ChooseTournament_Load(object sender, EventArgs e) + { + List list = Tournament.getTournaments(); + turns = new Tournament[list.Count]; + int c = 0; + foreach (Tournament t in list) + { + turns[c++] = t; + listBox.Items.Add(t.ToString()); + } + } + + private void bChoose_Click(object sender, EventArgs e) + { + if (listBox.SelectedIndex >= 0) + { + chosenTournament = turns[listBox.SelectedIndex]; + Close(); + } + } + + private void listBox_MouseDoubleClick(object sender, MouseEventArgs e) + { + bChoose_Click(sender, e); + } + } +} -- cgit v1.2.3