using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AHD.SM
{
    public partial class Frm_FirstRun : Form
    {
        public Frm_FirstRun()
        {
            InitializeComponent();

            //languages
            for (int i = 0; i < Program.SupportedLanguages.Length / 3; i++)
            {
                listBox1.Items.Add(Program.SupportedLanguages[i, 2]);
            }
            listBox1.SelectedIndex = 0;
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            button1.Enabled = listBox1.SelectedIndex >= 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Program.Language = Program.SupportedLanguages[listBox1.SelectedIndex, 0];
            Program.Settings.Language = Program.SupportedLanguages[listBox1.SelectedIndex, 0];
            Program.Settings.FirstRun = true;
            Close();
        }
    }
}
