diff options
author | Michal Zimniewicz <mzimniew@man.poznan.pl> | 2015-01-28 10:49:16 +0100 |
---|---|---|
committer | Michal Zimniewicz <mzimniew@man.poznan.pl> | 2015-01-28 10:58:38 +0100 |
commit | 29d9771333f9f996208b0e3dbce95dd80cddf8e9 (patch) | |
tree | 7160accad1184eabc2dbfadf4175aeeb6abf82dc /Aktywator/ChooseTournament.cs | |
parent | a331533373a95820a89aa93fead351ceb9a30046 (diff) |
initial commit with unreleased version 1.0.4
Diffstat (limited to 'Aktywator/ChooseTournament.cs')
-rw-r--r-- | Aktywator/ChooseTournament.cs | 47 |
1 files changed, 47 insertions, 0 deletions
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<Tournament> 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); + } + } +} |