private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { var cancel = e.Cancel; // CloseReason UnloadMode = e->CloseReason; <-- Removed because not used. if (!MainControl.AbleToClose() && !ForceClosure.ForceClose) { cancel = true; MessageManager.ShowInfo("Cannot close Els_kom while packing, unpacking, testing mods, or updating the game.", "Info!", Convert.ToBoolean(Convert.ToInt32(SettingsFile.Settingsxml?.TryRead("UseNotifications") != string.Empty ? SettingsFile.Settingsxml?.TryRead("UseNotifications") : "0"))); } if (!cancel) { SettingsFile.Settingsxml = null; } e.Cancel = cancel; }