Exemple #1
0
        /// <summary>
        /// Launches the Network Folder application on the device.
        /// </summary>
        public void Launch()
        {
            try
            {
                _controlPanel.Press(_executionManager.ScanButton);
                if (_controlPanel.WaitForDisplayedText("Scan Menu", TimeSpan.FromSeconds(3)))
                {
                    _controlPanel.Press("cScanToNetworkFolder");
                }

                Pacekeeper.Pause();
            }
            catch (PhoenixInvalidOperationException ex)
            {
                throw new DeviceWorkflowException($"Could not launch Select network folder page: {ex.Message}", ex);
            }
        }
        /// <summary>
        /// Types the number of copies to print in the control panel
        /// </summary>
        /// <param name="copies"></param>
        public void SetNumCopies(int copies)
        {
            _executionManager.PressSolutionButton("Copy", _executionManager.JobSettingsButton);
            _executionManager.PressSolutionButton("Copy Menu", _executionManager.NumberOfCopiesButton);

            _controlPanel.TypeOnVirtualKeyboard(copies.ToString());
            Thread.Sleep(1000);
            _controlPanel.Press(_executionManager.OkayButton);
            Thread.Sleep(1000);
        }
        /// <summary>
        /// Executes the currently configured scan job.
        /// </summary>
        /// <param name="scanForm">The scan form.</param>
        /// <returns><c>true</c> if the job finishes (regardless of its ending status), <c>false</c> otherwise.</returns>
        public bool ExecuteScanJob(string scanForm)
        {
            bool done = false;

            try
            {
                if (_controlPanel.WaitForVirtualButton("cScanTouchButton", TimeSpan.FromSeconds(1)))
                {
                    _controlPanel.Press("cScanTouchButton");
                    RecordEvent(DeviceWorkflowMarker.ScanJobBegin);
                    Thread.Sleep(TimeSpan.FromSeconds(25));
                    done = true;
                }
            }
            catch (PhoenixInvalidOperationException ex)
            {
                throw new DeviceWorkflowException($"Could not start job: {ex.Message}");
            }

            return(done);
        }
Exemple #4
0
        public string GenerateWpsPin()
        {
            NavigateToWireless();

            _controlPanel.Press("cWirelessWPSSetup");
            _pacekeeper.Pause();

            if (_controlPanel.GetDisplayedStrings().ToString().Replace("\n", string.Empty).Contains("not available"))
            {
                throw new NotSupportedException("Wireless configuration is possible when the printer is in wireless connection");
            }

            _controlPanel.Press("cWirelessGeneratePIN");
            IEnumerable <string> items = _controlPanel.GetDisplayedStrings();
            string pin = Regex.Match(items.First(x => x.Contains("PIN")), @"\d+").Value;

            return(pin);
        }
        /// <summary>
        /// Launches the Email application on the device.
        /// </summary>
        public void Launch()
        {
            try
            {
                _controlPanel.Press(_executionManager.ScanButton);

                if (_controlPanel.WaitForDisplayedText("Scan Menu", TimeSpan.FromSeconds(6)))
                {
                    _controlPanel.Press("cEmailUiEmailDocument");
                }

                Pacekeeper.Pause();

                if (_controlPanel.WaitForDisplayedText("Scan to E-mail", TimeSpan.FromSeconds(6)))
                {
                    _controlPanel.Press("cSendAnEmail");
                }
            }
            catch (PhoenixInvalidOperationException ex)
            {
                throw new DeviceWorkflowException($"Could not launch Email application: {ex.Message}", ex);
            }
        }