public static void FetchServerStatus() { try { ServerStatus s = GetTaskTransmissionManager().GetServerStatus(); switch (s) { case ServerStatus.Online: ServerStatusMonitor.SetServerStatusEnable(); break; case ServerStatus.Offline: ServerStatusMonitor.SetServerStatusDiabled(); break; case ServerStatus.UnknownError: ServerStatusMonitor.SetServerStatusErrorAddressAndPort(); break; } } catch (System.Net.WebException e) { ServerStatusMonitor.SetServerStatusErrorAddressAndPort(); } catch (System.Net.Sockets.SocketException e) { ServerStatusMonitor.SetServerStatusErrorAddressAndPort(); } catch { ServerStatusMonitor.SetServerStatusErrorAddressAndPort(); } }
private void FrmMain_Load(object sender, EventArgs e) { // Log an info level message log.Info("Application [" + System.Reflection.Assembly.GetEntryAssembly().GetName().Name + "] Start"); //Init ClientControlManager.Init(this); //Init ServerStatusMonitor ServerStatusMonitor.Init(this, this.labelServerStatus); //Refresh Application Interface RefreshClientControl(); RefreshMode(); //Refresh Server Status ConnectionManagerClient.FetchServerStatus(); //Show Vision this.Text = this.Text + " - " + Application.ProductVersion; }