/// <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>
        ///     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);
        }
예제 #4
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);
        }
        /// <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);
        }