private void OnMoveLast(object sender, EventArgs e)
{
if ((_ribbonSeparator != null) &&
(_ribbonSeparator.Ribbon != null) &&
_ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
{
// Use a transaction to support undo/redo actions
DesignerTransaction transaction = _designerHost.CreateTransaction("KryptonRibbonGroupSeparator MoveLast");
try
{
// Get access to the Items property
MemberDescriptor propertyItems = TypeDescriptor.GetProperties(_ribbonSeparator.RibbonGroup)["Items"];
RaiseComponentChanging(propertyItems);
// Move position of the triple
KryptonRibbonGroup ribbonGroup = _ribbonSeparator.RibbonGroup;
ribbonGroup.Items.Remove(_ribbonSeparator);
ribbonGroup.Items.Insert(ribbonGroup.Items.Count, _ribbonSeparator);
UpdateVerbStatus();
RaiseComponentChanged(propertyItems, null, null);
}
finally
{
// If we managed to create the transaction, then do it
if (transaction != null)
transaction.Commit();
}
}
}