/// <summary>
        /// Check if the FF H1 Communication DTM dialog box is shown
        /// </summary>
        /// <returns>
        ///     <br>True: if the dialog is shown in time</br>
        ///     <br>False: if dialog is not shown in time</br>
        /// </returns>
        public bool IsDialogShown()
        {
            var       dialogButton = new GUI.FFH1CommDTMRepoElements().DialogButtonOK;
            Stopwatch watch        = new Stopwatch();

            watch.Start();
            while (dialogButton == null)
            {
                if (watch.ElapsedMilliseconds >= 10000)
                {
                    return(false);
                }

                dialogButton = new GUI.FFH1CommDTMRepoElements().DialogButtonOK;
            }

            watch.Stop();

            if (dialogButton.Visible)
            {
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Closes a dialog
        /// </summary>
        /// <returns>
        ///     <br>True: if the dialog was successfully closed</br>
        ///     <br>False: if the dialog is still open</br>
        /// </returns>
        public bool Run()
        {
            var dialogMessage = new GUI.FFH1CommDTMRepoElements().DialogMessageBox;
            var buttonOk      = new GUI.FFH1CommDTMRepoElements().DialogButtonOK;
            var click         = new Functions.ApplicationArea.Execution.PressButton();
            var watch         = new Stopwatch();

            // log the dialog message
            Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), dialogMessage.TextValue);

            // close the dialog
            click.Run(buttonOk);

            // check if pop up is closed
            watch.Start();
            bool visible = buttonOk.Visible;

            while (!visible)
            {
                if (watch.ElapsedMilliseconds <= 30000)
                {
                    return(false);
                }

                visible = buttonOk.Visible;
            }

            watch.Stop();
            return(true);
        }
        /// <summary>
        /// Clicks the OK button
        /// </summary>
        public bool Run()
        {
            var pressButton = new Functions.ApplicationArea.Execution.PressButton();

            Button button = new GUI.FFH1CommDTMRepoElements().ButtonOK;

            return(pressButton.Run(button));
        }
        /// <summary>
        /// Clicks the cancel button
        /// </summary>
        public void Run()
        {
            var pressButton = new Functions.ApplicationArea.Execution.PressButton();

            Button button = new GUI.FFH1CommDTMRepoElements().ButtonCancel;

            pressButton.Run(button);
        }
Esempio n. 5
0
        /// <summary>
        /// Checks if button [OK] is available
        /// </summary>
        /// <returns>
        /// <br>True: if module is ready</br>
        ///     <br>False: if module is not ready</br>
        /// </returns>
        public bool Run()
        {
            Button button = new GUI.FFH1CommDTMRepoElements().ButtonOK;

            if (button == null)
            {
                return(false);
            }

            return(true);
        }