ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupTripleDesigner.OnAddRichTextBox C# (CSharp) 메소드

OnAddRichTextBox() 개인적인 메소드

private OnAddRichTextBox ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
리턴 void
        private void OnAddRichTextBox(object sender, EventArgs e)
        {
            if ((_ribbonTriple != null) &&
                (_ribbonTriple.Ribbon != null) &&
                 _ribbonTriple.RibbonGroup.Items.Contains(_ribbonTriple))
            {
                // Use a transaction to support undo/redo actions
                DesignerTransaction transaction = _designerHost.CreateTransaction("KryptonRibbonGroupTriple AddRichTextBox");

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

                    RaiseComponentChanging(propertyItems);

                    // Get designer to create a richtextbox item
                    KryptonRibbonGroupRichTextBox rtb = (KryptonRibbonGroupRichTextBox)_designerHost.CreateComponent(typeof(KryptonRibbonGroupRichTextBox));
                    _ribbonTriple.Items.Add(rtb);

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