Exemplo n.º 1
0
        /// <summary>
        /// Waits until the canceling progress is finished.
        /// </summary>
        /// <param name="timeoutInMilliseconds">
        /// The timeout in milliseconds.
        /// </param>
        /// <returns>
        /// <c>true</c> If canceling is finished and the parameter tree is visible again, <c>false</c> otherwise.
        /// </returns>
        public bool WaitUntilCancelingIsFinished(int timeoutInMilliseconds)
        {
            bool   result   = true;
            var    watch    = new Stopwatch();
            Button previous = new WHGSILNavigationElements().Previous;

            if (previous == null)
            {
                result = false;
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Previous button is null.");
            }
            else
            {
                watch.Start();

                while (previous.Visible)
                {
                    if (watch.ElapsedMilliseconds >= timeoutInMilliseconds)
                    {
                        result = false;
                        Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Canceling did not finish within " + timeoutInMilliseconds + " milliseconds.");
                        break;
                    }
                }
            }

            watch.Stop();
            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Canceling finished within " + timeoutInMilliseconds + " milliseconds.");
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether the SIL sequence start page is shown.
        /// </summary>
        /// <returns><c>true</c> if SIL sequence start page is shown; otherwise, <c>false</c>.</returns>
        public bool IsSilSequenceStartPageShown()
        {
            bool    result = true;
            Element logo   = new WHGSILNavigationElements().SilSequencePageLogo;

            if (logo == null)
            {
                result = false;
            }

            return(result);
        }
Exemplo n.º 3
0
        // ReSharper restore InconsistentNaming
        #region Public Methods and Operators

        /// <summary>
        ///     Click Cancel in Navigation Menu
        /// </summary>
        /// <returns>
        ///     <br>Button: If call worked fine</br>
        ///     <br>NULL: If an error occurred</br>
        /// </returns>
        public bool Cancel()
        {
            try
            {
                Button button = new WHGSILNavigationElements().Cancel;
                if (button != null && button.Enabled)
                {
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Clicking cancel button.");
                    button.Click(DefaultValues.locDefaultLocation);
                    return(true);
                }

                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Cancel button is not accessible");
                return(false);
            }
            catch (Exception exception)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), exception.Message);
                return(false);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Determines whether the confirm button is active.
        /// </summary>
        /// <returns><c>true</c> if confirm button is active; otherwise, <c>false</c>.</returns>
        public bool IsConfirmButtonActive()
        {
            try
            {
                bool   result;
                Button button = new WHGSILNavigationElements().Confirm;
                if (button == null)
                {
                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Confirm button is not accessible");
                    result = false;
                }
                else
                {
                    result = button.Enabled;
                }

                return(result);
            }
            catch (Exception exception)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), exception.Message);
                return(false);
            }
        }