Пример #1
0
        protected virtual void OnRemoveButtonClick(object sender, RoutedEventArgs e)
        {
            FileUploader fileUploader = DataContext as FileUploader;

            if (fileUploader != null)
            {
                fileUploader.RemoveUpload();
            }
        }
Пример #2
0
        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));
            }
        }