void ApplyConfig_Click(object sender, EventArgs e) { foreach (ListViewItem item in OptionsListView.Items) { ((LuiOptionsDialog)item.Tag).HandleApply(sender, e); } OptionsApplied.Raise(this, EventArgs.Empty); ApplyConfig.Enabled = false; // Can't apply again until options change. SaveConfig.Enabled = true; // Can save config after apply. }