public bool Initialize(out Exception error) { error = null; NetworkScanner = new NetworkScannerN(); //Set new data handler NetworkScanner.NewNetworkDataEvent += NetworkScannerNewNetworkDataEvent; //GPS GpsControl = new GpsController(); Logger = new GpxDataLogger { AutoSave = true, AutoSaveInterval = TimeSpan.FromSeconds(10) }; //Null scanning _tNullScan.Elapsed += TNullScanElapsed; //Init the interface manager InterfaceManager.Instance.Init(out error); return true; }
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; }