aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/MainMenu/Loading.cs
blob: c1c0ba0af7ac0ffa30d1c84bf77e5b512d63c0dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ShiftOS.Engine;

namespace ShiftOS.WinForms.MainMenu
{
    public partial class Loading : Form
    {
        public Loading()
        {
            InitializeComponent();
            label.Text = Localization.Parse(label.Text);
        }

        private void Loading_FormShown(object sender, EventArgs e)
        {
            // This hideous timer thing is the most reliable way to make the form update
            // before it starts doing stuff.
            var callback = new Timer();
            callback.Tick += (o, a) => { Desktop.CurrentDesktop.Show(); Hide(); callback.Stop(); };
            callback.Interval = 1;
            callback.Start();
        }
    }
}