2017-04-02 20:42:42 +00:00
|
|
|
|
using System;
|
2017-04-10 23:28:44 +00:00
|
|
|
|
using System.Collections;
|
2017-04-02 20:42:42 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms
|
|
|
|
|
{
|
|
|
|
|
public partial class SAV_GameSelect : Form
|
|
|
|
|
{
|
|
|
|
|
public GameVersion Result = GameVersion.Invalid;
|
2017-04-10 23:28:44 +00:00
|
|
|
|
public SAV_GameSelect(IEnumerable items)
|
2017-04-02 20:42:42 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
CB_Game.DisplayMember = nameof(ComboItem.Text);
|
|
|
|
|
CB_Game.ValueMember = nameof(ComboItem.Value);
|
|
|
|
|
CB_Game.DataSource = new BindingSource(items, null);
|
|
|
|
|
CB_Game.SelectedIndex = 0;
|
|
|
|
|
CB_Game.Focus();
|
|
|
|
|
}
|
|
|
|
|
private void B_Cancel_Click(object sender, EventArgs e) => Close();
|
|
|
|
|
private void B_OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Result = (GameVersion)WinFormsUtil.GetIndex(CB_Game);
|
2017-04-02 20:42:42 +00:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
private void SAV_GameSelect_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
|
|
B_OK_Click(null, null);
|
|
|
|
|
if (e.KeyCode == Keys.Escape)
|
|
|
|
|
B_Cancel_Click(null, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|