/// <summary>
        /// Evaluates whether downloading was successful
        /// </summary>
        /// <returns><c>true</c> if 'Download succeeded' message is shown in the 'Status of Save/Restore Assistant' box, <c>false</c> otherwise.</returns>
        public bool WasDownloadSuccessful()
        {
            bool result = true;

            Element status = new SelectionElements().TxtStatusOfDevice;

            if (status == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The element 'StatusOfDevice' is null");
                result = false;
            }
            else
            {
                if (status.GetAttributeValueText("Text") != @"Up-/download inactive" && status.GetAttributeValueText("Text") != "Download succeeded")
                {
                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The current status of the device is: '" + status.GetAttributeValueText("Text") + "'.");
                    result = false;
                }
                else
                {
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Download succeeded");
                }
            }

            return(result);
        }
        /// <summary>
        /// Evaluates whether restoring was successful
        /// </summary>
        /// <returns><c>true</c> if 'Restoring finished successfully' message is shown in the 'Status of Save/Restore Assistant' box, <c>false</c> otherwise.</returns>
        public bool WasRestoringSuccessful()
        {
            bool result = true;

            Element status = new SelectionElements().TxtStatusOfSaveRestoreModule;

            if (status == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The element 'StatusOfSaveRestoreModule' is null");
                result = false;
            }
            else
            {
                if (status.GetAttributeValueText("Text") != "Restoring finished successfully")
                {
                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The current status of the Save/Restore module is: '" + status.GetAttributeValueText("Text") + "'.");
                    result = false;
                }
                else
                {
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Restoring finished successfully");
                }
            }

            return(result);
        }
예제 #3
0
        /// <summary>
        ///     Save file with default name
        /// </summary>
        /// <returns>
        ///     <br>True: If call worked fine</br>
        ///     <br>False: If an error occurred</br>
        /// </returns>
        public bool Load()
        {
            Element button = new SelectionElements().BtnRestoreFrom;

            if (button != null && button.Enabled)
            {
                Mouse.MoveTo(button, 500);
                Mouse.Click();
                return(true);
            }

            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element is not available.");
            return(false);
        }
예제 #4
0
        /// <summary>
        ///     Get State Information
        /// </summary>
        /// <returns>
        ///     <br>True: If call worked fine</br>
        ///     <br>False: If an error occurred</br>
        /// </returns>
        public string GetStateInformation()
        {
            Element stateInformation = new SelectionElements().TxtStatusOfDevice;

            if (stateInformation == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element state information is null");
                return(string.Empty);
            }

            string result = stateInformation.GetAttributeValueText("Text");

            return(result);
        }
예제 #5
0
        /// <summary>
        ///     Get progress Information
        /// </summary>
        /// <returns>
        ///     <br>True: If call worked fine</br>
        ///     <br>False: If an error occurred</br>
        /// </returns>
        public string GetProgressInformation()
        {
            Element progressInformation = new SelectionElements().TxtStatusOfSaveRestoreModule;

            if (progressInformation == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element progress information is null");
                return(string.Empty);
            }

            string result = progressInformation.GetAttributeValueText("Text");

            return(result);
        }
예제 #6
0
        /// <summary>
        ///     Clicks checkbox Upload
        /// </summary>
        /// <returns>
        ///     <br>True: If call worked fine</br>
        ///     <br>False: If an error occurred</br>
        /// </returns>
        public bool SelectUpload()
        {
            CheckBox checkBox = new SelectionElements().CbUpload;

            if (checkBox != null && checkBox.Enabled)
            {
                checkBox.MoveTo(2000);
                Mouse.Click();
                return(true);
            }

            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element is not available.");
            return(false);
        }
예제 #7
0
        /// <summary>
        /// Selects the download mode duplicate.
        /// </summary>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public bool SelectDownloadModeDuplicate()
        {
            RadioButton duplicate = new SelectionElements().DownloadModeDuplicate;

            if (duplicate != null)
            {
                duplicate.MoveTo(2000);
                Mouse.Click();
                return(true);
            }

            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element is not available.");
            return(false);
        }
예제 #8
0
        /// <summary>
        /// Selects the download mode all parameters.
        /// </summary>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public bool SelectDownloadModeAllParameters()
        {
            RadioButton allParameters = new SelectionElements().DownloadModeAllParameter;

            if (allParameters != null)
            {
                allParameters.MoveTo(2000);
                Mouse.Click();
                return(true);
            }

            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Element is not available.");
            return(false);
        }
        /// <summary>
        /// Gets the current device status as shown in the Save/Restore module
        /// </summary>
        /// <returns>
        /// The current status
        /// </returns>
        public string GetCurrentStatus()
        {
            string  result = string.Empty;
            Element status = new SelectionElements().TxtStatusOfDevice;

            if (status == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The element 'StatusOfDevice' is null");
            }
            else
            {
                result = status.GetAttributeValueText("Text");
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The current status of the device is: '" + result + "'.");
            }

            return(result);
        }
예제 #10
0
 private void Select(string value)
 {
     SelectionElements.First(x => x.Current.Name == value).AsSelectionItem().Select();
 }