This repository has been archived on 2024-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
CDSAE3/CDSAE3_Lian_Lian_Kan/Forms/MainForm.cs

50 lines
1.6 KiB
C#
Raw Normal View History

2024-03-22 09:03:01 +00:00
using CDSAE3_Lian_Lian_Kan.Forms;
2024-04-18 00:38:59 +00:00
using CDSAE3_Lian_Lian_Kan.Properties;
using System.Text.Json;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using System.ComponentModel;
using CDSAE3_Lian_Lian_Kan.Forms.Interface;
2024-03-22 09:03:01 +00:00
2024-04-18 00:38:59 +00:00
namespace CDSAE3_Lian_Lian_Kan.Forms
2024-03-22 09:03:01 +00:00
{
public partial class LianLianKan : Form
{
public LianLianKan()
{
InitializeComponent();
2024-04-18 00:38:59 +00:00
Etcs.hunderd_millsecond_timer.Elapsed += StartFunc;
2024-04-02 13:57:04 +00:00
Etcs.form = this;
2024-03-22 09:03:01 +00:00
}
2024-04-18 00:38:59 +00:00
private void StartFunc(object? Sender, EventArgs e)
2024-03-22 09:03:01 +00:00
{
2024-04-18 00:38:59 +00:00
Etcs.hunderd_millsecond_timer.Elapsed -= StartFunc;
Form? menuForm = null;
Invoke(() => menuForm = new Leisure_Mode_MenuForm());
Invoke(() => change_form(menuForm!, false, null, null, false, null));
}
public async Task change_form(Form newForm, bool doAnimation, Color? begin, Color? end, bool haveImage, Image? image)
{
if (doAnimation)
{
bufferForm.SetEffect(begin!.Value, end!.Value, haveImage, image);
bufferForm.BringToFront();
bufferForm.Visible = true;
}
2024-03-22 09:03:01 +00:00
MainPanel.Controls.Clear();
2024-04-18 00:38:59 +00:00
newForm.TopLevel = false;
newForm.Dock = DockStyle.Fill;
(newForm as IThemeChangeable)?.SetTheme();
MainPanel.Controls.Add(newForm);
BeginInvoke(() => newForm.Show());
MainPanel.SendToBack();
if (doAnimation)
{
await bufferForm.EffectAsync();
bufferForm.Visible = false;
}
2024-04-02 13:57:04 +00:00
GC.Collect();
2024-03-22 09:03:01 +00:00
}
}
}