Example #1
0
 protected void OnFlagChanging(FlagChangingEventArgs e)
 {
     if (FlagChanging != null)
     {
         FlagChanging(this, e);
     }
 }
Example #2
0
        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;
            }
        }