You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AssistDB/SplashScreen.cs

57 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Text.Json;
namespace AssistDB
{
public partial class SplashScreen : Form
{
public SplashScreen()
{
InitializeComponent();
}
Timer tmr;
private void SplashScreen_Shown(object sender, EventArgs e)
{
tmr = new Timer();
//set time interval 3 sec
tmr.Interval = 3000;
//starts the timer
tmr.Start();
tmr.Tick += tmr_Tick;
}
void tmr_Tick(object sender, EventArgs e)
{
var path = System.IO.Path.Combine(Application.StartupPath, @"Sources\tableSchema.json");
List<Class1> jsonFile = JsonSerializer.Deserialize<List<Class1>>(File.ReadAllText(path));
AssitDB assit = new AssitDB(jsonFile);
//after 3 sec stop the timer
tmr.Stop();
//display mainform
assit.Show();
//hide this form
this.Hide();
}
}
}