/// <summary> /// Populate the list of available files to download. /// </summary> private void OnPopulateDownloadList() { // If the ADCP is pinging, make it stop _adcpConn.StopPinging(); // The D command will cancel any pending downloads // Send it twice to first ignore the last packet sent, then // stop the download process _adcpConn.SendData(string.Format("{0}", RTI.Commands.AdcpCommands.CMD_DS_CANCEL)); _adcpConn.SendData(string.Format("{0}", RTI.Commands.AdcpCommands.CMD_DS_CANCEL)); // Send command to the ADCP to give a list of all the files RTI.Commands.AdcpDirListing dirListing = _adcpConn.GetDirectoryListing(); // Populate the list with all the files found Application.Current.Dispatcher.BeginInvoke(new System.Action(() => PopulateDownloadList(dirListing))); }