protected bool OnUndo(object args)
{
if (FocusControlHandlesMessage("OnUndo", new[] { args }))
return true;
var ah = Cache.DomainDataByFlid.GetActionHandler();
if (ah.CanUndo())
{
// start hour glass
using (new WaitCursor(this))
{
try
{
m_fInUndoRedo = true;
ah.Undo();
}
finally
{
m_fInUndoRedo = false;
}
}
// Trigger a selection changed, to force updating of controls like the writing system combo
// that might be affected, if relevant.
var focusRootSite = GetFocusControl() as SimpleRootSite;
if (focusRootSite != null && !focusRootSite.IsDisposed &&
focusRootSite.RootBox != null && focusRootSite.RootBox.Selection != null)
{
focusRootSite.SelectionChanged(focusRootSite.RootBox, focusRootSite.RootBox.Selection);
}
return true;
}
return false;
}