Exemple #1
0
 /// <summary>
 /// Restart the search
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     nscan.DeviceFound -= NetworkScanner_OnDeviceFound;
     lstLocal.Clear();
     nscan              = new NetworkScanner();
     nscan.DeviceFound += NetworkScanner_OnDeviceFound;
     nscan.StartScan();
 }
Exemple #2
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            selectedDevice       = null;
            savedDeviceList      = new DeviceList();
            discoveredDeviceList = new DeviceList();
            nscan = new NetworkScanner();


            // import the saved devices from the xml file
            var data = (List <Device>)XMLManager.Deserialize(typeof(List <Device>));

            if (data != null)
            {
                foreach (var dev in data)
                {
                    savedDeviceList.AddDevice(dev);
                }
            }

            nscan.DeviceFound  += NetworkScanner_OnDeviceFound;
            nscan.ScanComplete += NetworkScanner_OnScanComplete;
            nscan.StartScan();
        }