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