Esempio n. 1
0
 private void listView1_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
         foreach (string filePath in files)
         {
             if (Directory.Exists(filePath))
             {
                 CommonInterface.GetFilesFromFolder(filePath, true);
             }
             else
             {
                 CommonInterface.CheckExtension(new FileInfo(filePath), true);
             }
         }
     }
 }
Esempio n. 2
0
 public static void GetDataFromClipboard(bool isRadio = false)
 {
     if (Clipboard.ContainsFileDropList())
     {
         StringCollection files = Clipboard.GetFileDropList();
         if (isRadio)
         {
             Link2.listBox1.BeginUpdate();
         }
         else
         {
             Link1.listView1.BeginUpdate();
         }
         foreach (string filePath in files)
         {
             if (Directory.Exists(filePath))
             {
                 CommonInterface.GetFilesFromFolder(filePath, isRadio);
             }
             else
             {
                 CommonInterface.CheckExtension(new FileInfo(filePath), isRadio);
             }
         }
         if (isRadio)
         {
             Link2.listBox1.EndUpdate();
         }
         else
         {
             Link1.listView1.EndUpdate();
         }
     }
     else if (isRadio && Clipboard.ContainsText())
     {
         AddTrackOrURL(Clipboard.GetText(), isRadio);
     }
 }