ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupLinesDesigner.OnAddRadioButton C# (CSharp) Метод

OnAddRadioButton() приватный Метод

private OnAddRadioButton ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void OnAddRadioButton(object sender, EventArgs e)
        {
            if ((_ribbonLines != null) &&
                (_ribbonLines.Ribbon != null) &&
                 _ribbonLines.RibbonGroup.Items.Contains(_ribbonLines))
            {
                // Use a transaction to support undo/redo actions
                DesignerTransaction transaction = _designerHost.CreateTransaction("KryptonRibbonGroupLines AddRadioButton");

                try
                {
                    // Get access to the Items property
                    MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonLines)["Items"];

                    RaiseComponentChanging(propertyItems);

                    // Get designer to create a radio button item
                    KryptonRibbonGroupRadioButton radioButton = (KryptonRibbonGroupRadioButton)_designerHost.CreateComponent(typeof(KryptonRibbonGroupRadioButton));
                    _ribbonLines.Items.Add(radioButton);

                    RaiseComponentChanged(propertyItems, null, null);
                }
                finally
                {
                    // If we managed to create the transaction, then do it
                    if (transaction != null)
                        transaction.Commit();
                }
            }
        }