public bool TestConn(bool bForcibly, BarcodeScanner xBCS, FuncPanel xFP) { bool ret = true; //string sOldInf = xFPan.RegInf; WiFiStat.CONN_TYPE cT = xBCS.WiFi.ConnectionType(); if ((cT == WiFiStat.CONN_TYPE.NOCONNECTIONS) || (bForcibly)) { bool bHidePan = false; if (!xFP.IsShown) { //xBCS.WiFi.IsEnabled = true; xBCS.WiFi.ShowWiFi((Control)xFP.xPan, true); xFP.ShowP(6, 50, "Переподключение к сети", "Wi-Fi"); bHidePan = true; } Cursor crsOld = Cursor.Current; Cursor.Current = Cursors.WaitCursor; xFP.RegInf = "Переподключение Wi-Fi..."; ret = xBCS.WiFi.ResetWiFi(2); if (ret) { Thread.Sleep(4000); xBCS.WiFi.GetIPList(); xFP.RegInf = "IP: " + xBCS.WiFi.IPCurrent; } else { xFP.RegInf = "Wi-Fi недоступен..."; } if (bHidePan) { xFP.HideP(); } Cursor.Current = crsOld; } return(ret); }
private bool TestConnection() { bool ret = true; WiFiStat.CONN_TYPE cT = xBCScanner.WiFi.ConnectionType(); if (cT == WiFiStat.CONN_TYPE.NOCONNECTIONS) { bool bHidePan = false; if (!xFPan.IsShown) { xFPan.ShowP(6, 50, "Переподключение к сети", "Wi-Fi"); bHidePan = true; } Cursor crsOld = Cursor.Current; Cursor.Current = Cursors.WaitCursor; xFPan.RegInf = "Переподключение Wi-Fi..."; ret = xBCScanner.WiFi.ResetWiFi(2); if (ret) { xFPan.RegInf = "IP получен:" + xBCScanner.WiFi.IPCurrent; } else { xFPan.RegInf = "Wi-Fi недоступен..."; } if (bHidePan) { xFPan.HideP(); } Cursor.Current = crsOld; } return(ret); }