protected virtual void OnRemoveButtonClick(object sender, RoutedEventArgs e) { FileUploader fileUploader = DataContext as FileUploader; if (fileUploader != null) { fileUploader.RemoveUpload(); } }
public void RemoveUpload(string fileName) { IEnumerable <FileUploader> files = m_files.Where(tent => tent.FileName == fileName); if (files.Count() > 0) { FileUploader tfile = files.First(); tfile.RemoveUpload(); m_files.Remove(tfile); } else { throw new IOException(String.Format("文件名为“{0}”的文件不在上传队列中。", fileName)); } }