示例#1
0
        // ReSharper restore InconsistentNaming
        #region Public Methods and Operators

        /// <summary>
        ///     Determines whether DTM (HISTOROM module) is offline
        /// </summary>
        /// <returns>
        ///     true: if DTM is offline
        ///     false: if DTM is online or an error occurred
        /// </returns>
        public bool Run()
        {
            bool   result = false;
            string state  = new StatusBarElements().ConnectionState;

            if (state == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Connection State is null");
            }
            else
            {
                string      hostApplicationLanguage = CommonFlows.GetHostApplicationLanguage.Run();
                string      connectionState         = string.Empty;
                ResourceSet languages = OfflineConnectionStateTranslations.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
                foreach (DictionaryEntry language in languages)
                {
                    if (hostApplicationLanguage == language.Key.ToString())
                    {
                        connectionState = language.Value.ToString();
                        Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Connection state translated: " + connectionState + ".");
                        break;
                    }
                }

                if (state.Equals(connectionState))
                {
                    result = true;
                }
            }

            return(result);
        }
 public void should_add_the_predefined_components_to_the_status_bar()
 {
     foreach (var element in StatusBarElements.All())
     {
         StatusBarElement elementToAdd = element;
         A.CallTo(() => _statusBarView.AddItem(elementToAdd)).MustHaveHappened();
     }
 }
示例#3
0
 public void Initialize()
 {
     StatusBarElements.All().Each(_view.AddItem);
     updateProjectInfo(AppConstants.None, string.Empty, string.Empty, false);
     update(StatusBarElements.Version)
     .WithCaption(_moBiConfiguration.FullVersionDisplay);
     hideProgressBar();
 }
示例#4
0
        /// <summary>
        ///     Searches for button "Operation in Progress" in the lower status bar of the module(found while reading)
        /// </summary>
        /// <returns>
        ///     true: if button is found
        ///     false: if button is not found
        /// </returns>
        public bool IsOperationInProgress()
        {
            Button operationInProgress = new StatusBarElements().ButtonOperationInProgress;

            return(operationInProgress != null);
        }
示例#5
0
 public void Initialize()
 {
     StatusBarElements.All().Each(_view.AddItem);
 }