private void MainForm_MoveOrResize(object sender, EventArgs e)
{
if (WindowState != FormWindowState.Minimized) {
settings.SetValue("mainForm.Location.X", Bounds.X);
settings.SetValue("mainForm.Location.Y", Bounds.Y);
settings.SetValue("mainForm.Width", Bounds.Width);
settings.SetValue("mainForm.Height", Bounds.Height);
}
}