/// <summary> /// Populate the list with all the possible files /// that can be downloaded. This will be all the /// ENS files on the ADCP. /// </summary> /// <param name="directoryListing">List of files.</param> private void PopulateDownloadList(RTI.Commands.AdcpDirListing directoryListing) { try { // Clear the current list DownloadFileList.Clear(); // Set the total and used space DownloadTotalSpace = directoryListing.TotalSpace.ToString() + " MB"; DownloadUsedSpace = directoryListing.UsedSpace.ToString() + " MB"; // Create a list of all the ENS files for (int x = 0; x < directoryListing.DirListing.Count; x++) { DownloadFileList.Add(new DownloadFile(directoryListing.DirListing[x]) { IsSelected = SelectAllFiles }); } this.NotifyOfPropertyChange(() => this.CanDownloadData); } catch (Exception e) { log.Error("Error downloading list of files.", e); } }
private void AddFile() { if (!string.IsNullOrEmpty(DownloadUrl)) { if (LoginModel.IsLogin) { var file = new DownloadItemViewModel(DownloadUrl, DownloadDir, Filename, LoginModel.Cookie); DownloadFileList.Add(file); DownloadUrl = null; } else { MessageBox.Show("请先登录!"); } } }