public void Init(out Exception error) { error = null; if(Utilities.IsXp()) return; try { WlanClient = new WlanClient(); } catch (Win32Exception exception) { error = exception; return; } catch (DllNotFoundException) { error = new Exception(Localizer.GetString("WlanapiNotFound")); return; } WlanClient.InterfaceArrivedEvent.ItsEvent += WlanClient_InterfaceArrivedEvent; WlanClient.InterfaceRemovedEvent.ItsEvent += WlanClient_InterfaceRemovedEvent; }
internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info) { _client = client; _info = info; }
private void StartScanning(WlanClient.WlanInterface intf, int scaninterval) { if (intf == null) return; NetworkScanner.MyWlanInterface = intf; NetworkScanner.Start(scaninterval); return; }
public WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info) { _client = client; _info = info; }
public bool Initalize(out Exception error) { error = null; NetworkScanner = new NetworkScanner(); //Set new data handler NetworkScanner.NewNetworkDataEvent += NetworkScannerNewNetworkDataEvent; Cache = new NetworkDataCacheN(); //GPS GpsControl = new GpsController(); GpsControl.GpsUpdated += GpsControl_GpsUpdated; GpsControl.GpsTimeout += GpsControl_GpsTimeout; GpsControl.GpsError += GpsControl_GpsError; GpsControl.GpsLocationUpdated += GpsControl_GpsLocationUpdated; Logger = new GpxDataLogger { AutoSave = true, AutoSaveInterval = TimeSpan.FromSeconds(10) }; //Null scanning _tNullScan.Elapsed += TNullScanElapsed; try { WlanClient = new WlanClient(); } catch (Win32Exception exception) { error = exception; return false; //MessageBox.Show("Error Initializing Wlan Client: " + exception.Message + "\n\nWi-Fi data will not be displayed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } catch (DllNotFoundException) { error = new Exception(Localizer.GetString("WlanapiNotFound")); return false; //MessageBox.Show("Error: wlanapi.dll could not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } return true; }