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