mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 13:03:06 +00:00
d4ea56cfd6
Remove numerous inter-form dependencies, remove hard-coded offsets, update a few spots to use better programming practices. Should increase the readability of PKHeX's source code.
27 lines
No EOL
906 B
C#
27 lines
No EOL
906 B
C#
using System.Timers;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PKHeX
|
|
{
|
|
public partial class SplashScreen : Form
|
|
{
|
|
public SplashScreen()
|
|
{
|
|
InitializeComponent();
|
|
System.Timers.Timer myTimer = new System.Timers.Timer();
|
|
myTimer.Elapsed += DisplayTimeEvent;
|
|
myTimer.Interval = 50; // milliseconds per trigger interval
|
|
myTimer.Start();
|
|
}
|
|
public void DisplayTimeEvent(object source, ElapsedEventArgs e)
|
|
{
|
|
if (!Main.init)
|
|
if (L_Status.InvokeRequired) L_Status.Invoke((MethodInvoker)delegate { L_Status.Text = Main.Status; });
|
|
else { L_Status.Text = Main.Status; }
|
|
else
|
|
if (InvokeRequired && IsHandleCreated)
|
|
try { Invoke((MethodInvoker)Close); } catch { Close(); }
|
|
else Close();
|
|
}
|
|
}
|
|
} |