using CDSAE3_Lian_Lian_Kan.Forms; 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; namespace CDSAE3_Lian_Lian_Kan.Forms { public partial class LianLianKan : Form { public LianLianKan() { InitializeComponent(); Etcs.hunderd_millsecond_timer.Elapsed += StartFunc; Etcs.form = this; } private void StartFunc(object? Sender, EventArgs e) { 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; } MainPanel.Controls.Clear(); 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; } GC.Collect(); } } }