/// <summary> /// Launches Scan to Network Folder using the specified authenticator and authentication mode. /// </summary> /// <param name="authenticator">The authenticator.</param> /// <param name="authenticationMode">The authentication mode.</param> /// <exception cref="DeviceWorkflowException"></exception> /// <exception cref="System.NotImplementedException">Eager authentication has not been implemented for this solution.</exception> public void Launch(IAuthenticator authenticator, AuthenticationMode authenticationMode) { if (authenticationMode.Equals(AuthenticationMode.Lazy)) { try { _controlPanel.Press("cScanHomeTouchButton"); if (_controlPanel.WaitForDisplayedText("Scan Menu", TimeSpan.FromSeconds(1))) { _controlPanel.Press("cScanToNetworkFolder"); } Thread.Sleep(TimeSpan.FromSeconds(2)); authenticator.Authenticate(); Thread.Sleep(_controlPanel.DefaultWaitTime); //Check control panel for errors List <string> errorMessage = _controlPanel.GetDisplayedStrings().ToList(); if (errorMessage.Contains("Your printer was unable to connect to\nthe server.\nCheck your network connection and try\nagain.")) { throw new DeviceWorkflowException($"Could not sign in: {errorMessage}"); } } catch (PhoenixInvalidOperationException ex) { throw new DeviceWorkflowException($"Could not launch Select network folder page: {ex.Message}", ex); } } else { throw new NotImplementedException("Eager authentication has not been implemented for this solution."); } }
/// <summary> /// Enters the name to use for the scanned file. /// </summary> /// <param name="fileName">The file name.</param> public void EnterFileName(string fileName) { if (_controlPanel.WaitForDisplayedText("Scan to E-mail", TimeSpan.FromSeconds(1))) { _controlPanel.Press("cJobSettings"); _controlPanel.Press("Scroll Down Arrow"); var screenText = _controlPanel.GetDisplayedStrings().ToList(); if (screenText.Contains("File Name Prefix")) { _controlPanel.Press("cFilenamePrefix"); Pacekeeper.Pause(); var keyTexts = _controlPanel.GetDisplayedStrings().ToList(); int count = keyTexts.ElementAt(0).Count(); for (int i = 0; i < count; i++) { _controlPanel.Press("Del"); } _controlPanel.TypeOnVirtualKeyboard(fileName); _controlPanel.Press("cOKTouchButton"); } } }