public void DragDropEvent(object sender, DragEventArgs e)
        {
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            int sayi = 0;
            for (sayi = 0; sayi < files.Length; sayi++)
            {
                string file = files[sayi].ToString();
                string[] fileName = file.Split('\\');
                string[] fileType = fileName[fileName.Length - 1].Split('.');
                string fullPath = files[sayi].ToString();
                string typeOffile = "";

                DirectoryInfo director = new DirectoryInfo(file);

                if (fileType[fileType.Length - 1].ToLower() == "cmpl")
                {
                    typeOffile = "cmpl";
                }
                else if (fileType[fileType.Length - 1].ToLower() == "wma" || fileType[fileType.Length - 1].ToLower() == "snd" || fileType[fileType.Length - 1].ToLower() == "aif" || fileType[fileType.Length - 1].ToLower() == "aiff" || fileType[fileType.Length - 1].ToLower() == "au" || fileType[fileType.Length - 1].ToLower() == "mp3" || fileType[fileType.Length - 1] == "mp4" || fileType[fileType.Length - 1].ToLower() == "avi" || fileType[fileType.Length - 1].ToLower() == "mpg" || fileType[fileType.Length - 1].ToLower() == "mpeg" || fileType[fileType.Length - 1].ToLower() == "wmv" || fileType[fileType.Length - 1].ToLower() == "mov" || fileType[fileType.Length - 1].ToLower() == "flv" || fileType[fileType.Length - 1].ToLower() == "wav" || fileType[fileType.Length - 1].ToLower() == "wma" || fileType[fileType.Length - 1].ToLower() == "vob" || fileType[fileType.Length - 1].ToLower() == "dat" || fileType[fileType.Length - 1].ToLower() == "3gp")
                {
                    typeOffile = "media";
                }
                else if (director.Attributes == director.Attributes)
                {
                    typeOffile = "director";
                }

                else
                    typeOffile = fileType[fileType.Length - 1].ToString();
                switch (typeOffile)
                {
                    case "cmpl":
                        int filesayi = 0;
                        StreamReader sr = new StreamReader(fullPath);
                        fileNames = new String[1000];
                        filesayi = 0;
                        while (!sr.EndOfStream)
                        {
                            fileNames[filesayi] = sr.ReadLine().ToString();
                            filesayi++;
                        }
                        addList(fileNames, filesayi);
                        break;
                    case "media":
                        string[] mp3files = new String[1000];
                        mp3files[0] = files[sayi].ToString();
                        addList(mp3files, 1);
                        break;
                    case "director":
                        this.filesayisi = 0;
                        this.NumOfDirs = 0;
                        DirectoryInfo basedirectory = new DirectoryInfo(files[sayi].ToString());
                        if (basedirectory.GetFiles().Length > 0)
                            fileadderfromdirectory(basedirectory);
                        MakeDecision(basedirectory.ToString());
                        break;
                    default:
                        MessageBox.Show(typeOffile + " format is not supported.\n Be sure that this file is a valid media file.");
                        break;
                }
            }
            searchform = new search(itemList, listoffilenames, fileIndex, filename);
            searchform.Refresh();
        }
 public From1(ListBox items, ListBox filenames, int fileindex, bool doubleClick, Label filename)
 {
     InitializeComponent();
     this.itemList = items;
     this.filename = filename;
     this.listoffilenames = filenames;
     itemList.SelectedIndex = fileindex;
     try
     {
         m_obj_BasicAudio.Volume = volumeValue;
         m_CurrentStatus = MediaStatus.Running;
         m_obj_MediaControl.Run();
     }
     catch { }
     OpenFileFuncTh(itemList.SelectedIndex);
     searchform = new search(itemList, listoffilenames, fileindex, filename);
     searchform.Refresh();
 }
 public From1(ListBox itemlist, ListBox filenames, Label filename, int fileindex)
 {
     InitializeComponent();
     UpdateToolStrip();
     this.filename = filename;
     this.itemList.Items.Clear();
     this.itemList.Items.AddRange(itemlist.Items);
     this.listoffilenames.Items.Clear();
     this.listoffilenames.Items.AddRange(filenames.Items);
     itemList.SelectedIndex = fileindex;
     fileIndex = itemList.SelectedIndex;
     if (!running)
         OpenFileFuncTh(0);
     searchform = new search(itemList, listoffilenames, 0, filename);
     searchform.Refresh();
 }
 public From1(ListBox itemlist, ListBox filenames, int width, int height, int x, int y, Label filename)
 {
     InitializeComponent();
     UpdateToolStrip();
     this.itemList.Items.Clear();
     this.itemList.Items.AddRange(itemlist.Items);
     this.listoffilenames.Items.Clear();
     this.listoffilenames.Items.AddRange(filenames.Items);
     this.filename = filename;
     setHeight(height);
     setWidth(width);
     setX(x);
     setY(y);
     fileIndex = getfileindex();
     newPlayerIsCreated = false;
     searchform = new search(itemList, listoffilenames, fileIndex, filename);
     searchform.Refresh();
 }
 public From1(ListBox itemlistfromsc, ListBox filenames, string TargetFile)
 {
     InitializeComponent();
     this.itemList.Items.Clear();
     itemList = itemlistfromsc;
     this.listoffilenames.Items.Clear();
     listoffilenames = filenames;
     this.Refresh();
     if (fileIndex == -1)
         fileIndex = 0;
     if (!running)
         OpenFileFuncTh(fileIndex);
     searchform = new search(itemList, listoffilenames, 0, filename);
     searchform.Refresh();
     fromweb = true;
     UpdateToolStrip();
 }