public void ChooseParentOfElement() { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "parent"); if (LastSelectedShapePolygonPoints != null) { LastSelectedShapePolygonPoints = null; fire_PolygonPointSelected_Reset(); if (LastSelectedShape != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change // LastSelectedShape = LastSelectedShape; fire_SelectedShapeChanged(ChangeReson.Object); //sayLastSelectedShape(); return; } } if (LastSelectedShape == null) { //try to get the first shape of the current page var activeDoc = OoConnection.GetActiveDrawDocument() as OoAccessibleDocWnd; if (activeDoc != null) { OoShapeObserver first = AccDomWalker.GetFirstShapeOfDocument(activeDoc); if (first != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = first; //sayLastSelectedShape(); } else { playError(); } } } else { OoShapeObserver parent = AccDomWalker.MoveToParent(LastSelectedShape); if (parent != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = parent as OoShapeObserver; //sayLastSelectedShape(); } else { playError(); } } }
/// <summary> /// Go to the next element in the document tree. /// </summary> public void ChooseNextElement() { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "next element"); if (LastSelectedShapePolygonPoints != null && LastSelectedShapePolygonPoints.IsValid() && LastSelectedShapePolygonPoints.Shape == LastSelectedShape) { SelectNextPolygonPoint(LastSelectedShapePolygonPoints != null && LastSelectedShapePolygonPoints.IsClosed(true)); } else if (LastSelectedShape == null) { //try to get the first shape of the current page var activeDoc = OoConnection.GetActiveDrawDocument() as OoAccessibleDocWnd; if (activeDoc != null) { OoShapeObserver first = AccDomWalker.GetFirstShapeOfDocument(activeDoc); if (first != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = first; //sayLastSelectedShape(); } else { playError(); } } } else { OoShapeObserver next = AccDomWalker.MoveToNext(LastSelectedShape); if (next != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = next as OoShapeObserver; //sayLastSelectedShape(); } else { playError(); } } }
public void ChooseFirstChildOfElement() { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "first child"); if (LastSelectedShape == null) { //try to get the first shape of the current page var activeDoc = OoConnection.GetActiveDrawDocument() as OoAccessibleDocWnd; if (activeDoc != null) { OoShapeObserver first = AccDomWalker.GetFirstShapeOfDocument(activeDoc); if (first != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = first; //sayLastSelectedShape(); } else { playError(); } } } else { int index = 0; OoShapeObserver child = AccDomWalker.MoveToChild(LastSelectedShape, ref index); if (child != null) { AudioRenderer.Instance.Abort(); // stop current audio to return the shape change LastSelectedShape = child as OoShapeObserver; //sayLastSelectedShape(); } else { SelectNextPolygonPoint(LastSelectedShapePolygonPoints != null && LastSelectedShapePolygonPoints.IsClosed(true)); if (LastSelectedShapePolygonPoints == null) { playError(); } } } }