ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupTripleDesigner.OnMoveLast C# (CSharp) Method

OnMoveLast() private method

private OnMoveLast ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void OnMoveLast(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 MoveLast");

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

                    RaiseComponentChanging(propertyItems);

                    // Move position of the triple
                    KryptonRibbonGroup ribbonGroup = _ribbonTriple.RibbonGroup;
                    ribbonGroup.Items.Remove(_ribbonTriple);
                    ribbonGroup.Items.Insert(ribbonGroup.Items.Count, _ribbonTriple);
                    UpdateVerbStatus();

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