-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashScreen.cs
More file actions
36 lines (30 loc) · 872 Bytes
/
SplashScreen.cs
File metadata and controls
36 lines (30 loc) · 872 Bytes
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
33
34
35
36
using CefSharp.WinForms;
using CefSharp;
using System;
using System.Windows.Forms;
using System.Threading.Tasks;
namespace ComparedLyric
{
public partial class SplashScreen : Form
{
public SplashScreen()
{
InitializeComponent();
}
private async void SplashScreen_Load(object sender, EventArgs e)
{
var settings = new CefSettings();
settings.CefCommandLineArgs.Add("autoplay-policy", "no-user-gesture-required");
Cef.Initialize(settings);
await OpenMainViewAfterDelay();
}
private async Task OpenMainViewAfterDelay()
{
await Task.Delay(3000);
MainView mainpage = new MainView();
mainpage.FormClosed += (s, args) => this.Close();
mainpage.Show();
Hide();
}
}
}