ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupCustomControlDesigner.OnEnabled C# (CSharp) Method

OnEnabled() private method

private OnEnabled ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void OnEnabled(object sender, EventArgs e)
        {
            if ((_ribbonCustomControl != null) && (_ribbonCustomControl.Ribbon != null))
            {
                PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonCustomControl)["Enabled"];
                bool oldValue = (bool)propertyEnabled.GetValue(_ribbonCustomControl);
                bool newValue = !oldValue;
                _changeService.OnComponentChanged(_ribbonCustomControl, null, oldValue, newValue);
                propertyEnabled.SetValue(_ribbonCustomControl, newValue);
            }
        }