protected void OnFlagChanging(FlagChangingEventArgs e) { if (FlagChanging != null) { FlagChanging(this, e); } }
private void checkedListBoxInner_ItemCheck(object sender, ItemCheckEventArgs e) { var enumVal = Enum.ToObject(innerFlagType, checkedListBoxInner.Items[e.Index]); var args = new FlagChangingEventArgs (enumVal, e.NewValue == CheckState.Checked); OnFlagChanging(args); if (args.CancelChange) { e.NewValue = e.CurrentValue; } }