コード例 #1
0
        private void Checkbox_CheckStateChanged(object sender, EventArgs e)
        {
            MaterialCheckbox checkbox = sender as MaterialCheckbox;

            if (checkbox == null)
            {
                return;
            }

            ModFile mod = checkbox.Tag as ModFile;

            if (mod == null)
            {
                return;
            }

            try
            {
                modHelper.SetActive(mod, checkbox.Checked);
            } catch (Exception ex)
            {
                MessageBox.Show("The mod couldn't be " + ((checkbox.Checked) ? "enabled" : "disabled") + ". Please make sure that the game is closed!\n" + ex.Message);
            }
        }