public AboutForm(ModManagerForm form) { InitializeComponent(); modManager = form; // Use the same icon as executable Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); pictureBox.Image = Icon.ToBitmap(); // Get values from ModManagerForm autoupdateCheckBox.Checked = modManager.GetSetting(ModManagerForm.AUTOUPDATE) == 1; if (modManager.GetSetting(ModManagerForm.AOT_COMPILATION) == 1) { AOTCompilationRadioButton.Checked = true; } else if (modManager.GetSetting(ModManagerForm.MULTITHREADED_JIT) == 1) { multithreadedJITCompilationRadioButton.Checked = true; } else { singlethreadedJITCompilationRadioButton.Checked = true; } // We have to add those methods to the EventHandler here so we could avoid accidental firing of those methods after we would change the state of the CheckBox autoupdateCheckBox.CheckedChanged += new EventHandler(AutoupdateCheckBox_CheckedChanged); singlethreadedJITCompilationRadioButton.CheckedChanged += new EventHandler(SinglethreadedJITCompilationRadioButton_CheckedChanged); multithreadedJITCompilationRadioButton.CheckedChanged += new EventHandler(MultithreadedJITCompilationRadioButton_CheckedChanged); AOTCompilationRadioButton.CheckedChanged += new EventHandler(AOTCompilationRadioButton_CheckedChanged); }
private void UpdateButton_Click(object sender, EventArgs e) { DialogResult result = DownloadHelper.CheckForUpdates(silently: false); if (result == DialogResult.OK && modManager.GetSetting(ModManagerForm.AOT_COMPILATION) == 1) { modManager.ChangeSetting(ModManagerForm.ACTION_STATE, (int)ModManagerForm.Action.CreateNativeImage); } }