SIL.FieldWorks.XWorks.FwXWindow.OnUndo C# (CSharp) Method

OnUndo() protected method

This function will undo the last changes done to the project. This function is executed when the user clicks the undo menu item.
protected OnUndo ( object args ) : bool
args object Unused
return bool
		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;
		}
FwXWindow