예제 #1
0
        // Turn on/off screen and check system status
        private void mCheckSystemWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (!mCheckSystemStatus)
            {
                return;
            }

            var status = new SystemStatus();

            e.Result = status;

            // Check connection
            if (!Starting && mAicMessageListener != null)
            {
                bool connectionOk = mAicMessageListener.CheckConnection();
                if (!connectionOk)
                {
                    mAicMessageListener.Disconnect();
                }
            }

            // Check internet and printer
            status.ConnectedToInternet = Network.IsConnectedToInternet();
            status.PrinterServerOk     = PrintHelper.CheckPrintServer(mAlarmPrinter.ServerName);
            if (status.PrinterServerOk)
            {
                status.PrinterOk = PrintHelper.CheckPrinter(mAlarmPrinter.ServerName, mAlarmPrinter.PrinterName);
            }
        }
        // Check print server
        private void CheckPrintServerButton_Click(object sender, RoutedEventArgs e)
        {
            string printServer = string.IsNullOrEmpty(PrintServerBox.Text) ? null : PrintServerBox.Text;
            bool   ok          = PrintHelper.CheckPrintServer(printServer);

            if (ok)
            {
                MessageBox.Show("Die Verbindung zum Druckserver ist in Ordnung.", "AIC");
            }
            else
            {
                MessageBox.Show("Es besteht keine Verbindung zum Druckserver", "AIC", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }