I18NCommander/I18N Commander/UI WinForms/Components/Main.cs

23 lines
752 B
C#

namespace UI_WinForms.Components;
public partial class Main : UserControl
{
public Main()
{
this.InitializeComponent();
Program.RestartMainApp = false;
}
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.settings.NeedRestart())
{
var result = MessageBox.Show("You need to restart the app for the changes to take effect. Do you want to restart?", "Restart required", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if(result == DialogResult.Yes)
{
Program.RestartMainApp = true;
this.ParentForm!.Close();
}
}
}
}