/// <summary> /// Sets the Orientation - Portrait or Landscape /// </summary> /// <param name="orientation">Orientation type set Potrait or Landscape </param> public void SetOrientation(ContentOrientation orientation) { ScrollToOption("CopyContentOrientationDialogButton"); _controlPanel.PressWait("CopyContentOrientationDialogButton", "ContentOrientationDialog", _waitTimeSpan); _controlPanel.Press(orientation.ToString().ToLower(CultureInfo.InvariantCulture)); _controlPanel.PressWait("m_OKButton", "CopyAppMainForm", _waitTimeSpan); }
/// <summary> /// Writes the given text into the given control ID. /// </summary> /// <param name="objectId">string</param> /// <param name="textToType">int</param> private void PlayKeyboard(string objectId, string textToType) { _engine.PressElementById(objectId); _controlPanel.WaitForControl("mKeyboard", TimeSpan.FromSeconds(3)); _controlPanel.TypeOnVirtualKeyboard("mKeyboard", textToType); Thread.Sleep(2000); _controlPanel.Press("ok"); }
private void PressSignOutButton() { try { if (_controlPanel.GetProperty(_signInButton, "Text") == "Sign Out") { _controlPanel.Press(_signInButton); } } catch (WindjammerInvalidOperationException wje) when(wje.Message.Contains("Did not receive the Click event from the control within 5 seconds")) { // ignoring the error since this only occasionally fails on the end of SafeCom workflows } catch (ControlNotFoundException) { throw new DeviceWorkflowException("Sign out button could not be found."); } }
/// <summary> /// Process for implementing the Jedi Image Preview workflow. /// </summary> /// <param name="ts">The ts.</param> private void ImagePreviewHpcr(TimeSpan ts) { PressHpcrButtonByCoordinate("", 1); PressPanelButton("Image Preview:"); PressPanelButton("On"); // press ok PressHpcrButtonByCoordinate("Start", 0); // press the start button RecordEvent(DeviceWorkflowMarker.ImagePreviewBegin); PressHpcrButtonByCoordinate("", 0); WaitForFormString("ImagePreviewForm", ts); RecordEvent(DeviceWorkflowMarker.ImagePreviewEnd); WaitForEnabled("mStartButton", TimeSpan.FromSeconds(15)); RecordEvent(DeviceWorkflowMarker.ScanJobBegin); _controlPanel.Press("mStartButton"); _engine.WaitForHtmlContains("Done", TimeSpan.FromSeconds(66)); RecordEvent(DeviceWorkflowMarker.ScanJobEnd); }
/// <summary> /// Selects the Optimize text or pitcure for the scanned file /// </summary> /// <param name="optimizeTextOrPicture">Selects the text or pitcure</param> public void SelectOptimizeTextOrPicture(OptimizeTextPic optimizeTextOrPicture) { ScrollToOption("CopyOptimizeTextPictureDialogButton"); if (_controlPanel.GetControls().Contains("CopyOptimizeTextPictureDialogButton")) { _controlPanel.PressWait("CopyOptimizeTextPictureDialogButton", "CopyOptimizeTextPictureDialog"); var controls = _controlPanel.GetControls().ToList(); if (controls.Contains("m_RadioButton")) { switch (optimizeTextOrPicture) { case OptimizeTextPic.Mixed: _controlPanel.Press("Mixed"); break; case OptimizeTextPic.Photo: _controlPanel.Press("Photo"); break; case OptimizeTextPic.Text: _controlPanel.Press("Text"); break; case OptimizeTextPic.Glossy: default: _controlPanel.Press("Glossy"); break; } _controlPanel.Press("m_OKButton"); } } }