Exemple #1
0
 private void ResetFileInfo(FileInfoModel fileinfo)
 {
     fileinfo.NewFilename    = "";
     fileinfo.IsCreateNewDir = false;
     fileinfo.NewDir         = "";
     fileinfo.Status         = "";
 }
Exemple #2
0
 private void FileListView_Drop(object sender, DragEventArgs e)
 {
     if (isDragingItem)
     {
         isDragingItem = false;
         int index = GetCurrentIndex(FileListView, e.GetPosition);
         if (FileListView.SelectedItems.Count > 0 && index >= 0 && index != FileList.IndexOf(FileListView.SelectedItems[0] as FileInfoModel))
         {
             foreach (FileInfoModel item in FileListView.SelectedItems)
             {
                 FileList.Move(FileList.IndexOf(item), index);
             }
         }
     }
     else
     {
         Array list = e.Data.GetData(DataFormats.FileDrop) as Array;
         foreach (var l in list)
         {
             string s = l as string;
             if (!string.IsNullOrEmpty(s))
             {
                 int           index = s.LastIndexOf("\\");
                 FileInfoModel model = new FileInfoModel()
                 {
                     Path        = s.Substring(0, index + 1),
                     OldFilename = s.Substring(index + 1)
                 };
                 FileList.Add(model);
             }
         }
     }
     SetStatusMessage("文件数:" + FileList.Count);
 }
Exemple #3
0
 private void AddFile(FileInfoModel model)
 {
     Application.Current.Dispatcher.Invoke(delegate {
         FileList.Add(model);
     });
 }