Example #1
0
        public void UpdateStatus()
        {
            bool      isConnected = CMSLogger.IsLoggerConnected();
            bool      isRunning   = CMSLogger.IsLoggerRunning();
            Exception e           = CMSLogger.GetNetworkException();

            if (e != null)
            {
                labelLogStatusDetails.Text = e.Message;
            }
            else
            {
                labelLogStatusDetails.Text = "";
            }

            bool        neverConnect = false;
            IDictionary vars         = Environment.GetEnvironmentVariables();

            if (vars.Contains("NeverConnect"))
            {
                neverConnect = Boolean.Parse(vars["NeverConnect"] as string);
            }

            if (!isRunning)
            {
                labelLogStatus.Text = "System is not Running";
            }
            else if (neverConnect)
            {
                labelLogStatus.Text = "System is Running and can never Connect";
            }
            else if (!isConnected)
            {
                labelLogStatus.Text = "System is Running, but not Connected";
            }
            else
            {
                labelLogStatus.Text = "System is Running and Connected";
            }
        }