Example #1
0
        private bool IsPrinting(JobStatusCheckBy checkBy)
        {
            try
            {
                return(_safeComApp.IsPrinting(checkBy));
            }
            catch (Exception ex)
            {
                ExecutionServices.SystemTrace.LogError("Error checking job status via control panel.", ex);
            }

            return(false);
        }
Example #2
0
        /// <summary>
        /// Determines whether the device is printing by checking for the presence of an alert with the text "Printing..."
        /// </summary>
        /// <param name="checkBy">The check by.</param>
        /// <returns><c>true</c> if the "Printing" alert is present; <c>false</c> otherwise.</returns>
        public bool IsPrinting(JobStatusCheckBy checkBy)
        {
            ScreenInfo screenInfo = _controlPanel.GetScreenInfo();

            try
            {
                Widget widget = screenInfo.Widgets.FindByValue("Printing", StringMatch.StartsWith);
                return(widget != null);
            }
            catch (ElementNotFoundException)
            {
                // "Printing" Screen not found.  Allow to return.
            }

            return(false);
        }
        /// <summary>
        /// Determines whether the device is printing.
        /// </summary>
        /// <param name="checkBy">Check by Oid, Control Panel, etc.</param>
        /// <returns><c>true</c> if the device is printing; otherwise, <c>false</c>.</returns>
        public bool IsPrinting(JobStatusCheckBy checkBy)
        {
            bool result = false;

            switch (checkBy)
            {
            case JobStatusCheckBy.Oid:
                result = CheckDeviceJobStatusByOid();
                break;

            case JobStatusCheckBy.ControlPanel:
                result = CheckDeviceJobStatusByControlPanel();
                break;

            default:
                result = true;
                break;
            }

            return(result);
        }