using System;
using System.Windows;
using System.Diagnostics;
using System.ComponentModel;

namespace Launcher
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class Load : Window
    {
        public Load()
        {
            InitializeComponent();
        }

        public void Main(object sender, EventArgs e)
        {
            BackgroundWorker Loader = new BackgroundWorker();
            Loader.DoWork += new DoWorkEventHandler(LoaderWork);
            Loader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoaderCompleted);
            Loader.RunWorkerAsync();
        }

        public void LoaderWork(object sender, DoWorkEventArgs e)
        {
            Methods.Load();
        }

        public void LoaderCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Process.Start("http://topofgames.com/index.php?do=votes&id=");
            this.Hide();
            Patch main = new Patch();
            main.Show();
            this.Close();
        }
    }
}
