private void B_FolderExport_Click(object sender, EventArgs e)
        {
            IsExport             = true;
            b_ShowErrors.Enabled = false;
            fbd_FolderExport.ShowDialog();

            ExportPath = fbd_FolderExport.SelectedPath;
            ss_Main_l_ExportDestination.Text = "Export Folder set to " + ExportPath;
            string[]   FilesInExport  = Directory.GetFiles(ExportPath);
            FileInfo[] ExportFileInfo = new FileInfo[FilesInExport.Length];
            for (int i = 0; i < FilesInExport.Length; i++)
            {
                ExportFileInfo[i] = new FileInfo(FilesInExport[i]);
            }

            ExportTable = FormLib.MakeTable(FormLib.TableTypes.ExportList);

            FormLib.PopulateTable(FormLib.TableTypes.ExportList, ref ExportTable, FormLib.MakeFileList(ExportFileInfo));

            DataView dv = new DataView(ExportTable);

            dgv_ExportPreview.DataSource = dv;

            IsExport      = false;
            ExportPathSet = true;
        }
        private void B_ExportPreview_Click(object sender, EventArgs e)
        {
            if (OpenListPopulated)
            {
                if (FileList.Count > 0 && !IsPreviewed)
                {
                    FormLib.PopulateTable(FormLib.TableTypes.ExportList, ref ExportTable, FileList);
                    IsPreviewed = true;
                }

                SearchForDuplicates(dgv_ExportPreview);
            }
            else
            {
                MessageBox.Show("You must first select a list file.", "Hang on...");
            }
        }
        private void D_OpenList_FileOk(object sender, CancelEventArgs e)
        {
            SourceFolderSet = false;
            fileName        = ((OpenFileDialog)sender).FileName;

            FileInfo fi = new FileInfo(fileName);

            FileList.Clear();
            if (AllValidFileTypes.Split(';').Contains(fi.Extension)) // Check for valid file type
            {
                StreamReader sr = new StreamReader(File.OpenRead(fileName));
                if (ImageFiles.Split(';').Contains(fi.Extension))
                {
                }
                else if (fi.Extension == PlaylistFile)
                {
                    /*Check for valid file type ♪
                     * Create internal view (table) ♪
                     * Find song source folder ♪
                     * Parse data from list ♪
                     * grab the whole list of songs ♪
                     * Populate the table  ♪
                     * Bind the data to DisplayGridView ♪
                     * Show list ♪
                     */



                    XDoc.LoadXml(sr.ReadToEnd());
                    XmlNodeList mediaList = XDoc.GetElementsByTagName("media");


                    if (mediaList.Count > 0)// Parse data from list
                    {
                        string mediaSource = "";
                        string musicPath   = "";
                        for (int i = 0; i < mediaList.Count; i++)
                        {
                            string   firstHalf = mediaList.Item(i).Attributes.GetNamedItem(FormLib.XML_STR_SRC).Value;
                            FileInfo songInfo;
                            mediaSource = firstHalf;
                            if (!File.Exists(mediaSource))//...or if the file location is not valid / complete
                            {
                                if (!SourceFolderSet)
                                {
                                    ShowSourceFolderDialog(); //Find song source folder
                                    musicPath       = fbd_SourceMusicFolder.SelectedPath;
                                    SourceFolderSet = true;
                                }

                                mediaSource = musicPath + @"\" + firstHalf.Replace("..\\", "");
                                mediaList.Item(i).Attributes.GetNamedItem(FormLib.XML_STR_SRC).Value = mediaSource;
                            }


                            if (FileList.FirstOrDefault(x => x.Name == mediaSource) == null && File.Exists(mediaSource))
                            {
                                songInfo = new FileInfo(mediaSource);
                                XmlNode      temp         = mediaList.Item(i).Clone();
                                XmlAttribute FileTypeAttr = XDoc.CreateAttribute(FormLib.XML_STR_FILE_TYPE);
                                FileTypeAttr.Value = songInfo.Extension;
                                XmlAttribute DateAttr = XDoc.CreateAttribute(FormLib.XML_STR_DATE_MODIFIED);
                                DateAttr.Value = songInfo.LastWriteTime.ToString();

                                temp.Attributes.Append(DateAttr);
                                temp.Attributes.Append(FileTypeAttr);

                                FileList.Add(temp); // grab the whole list of songs
                            }
                        }
                    }

                    MakeOpenListDataTable(fi.Extension); //Create internal view
                    DataView dv = new DataView(OpenListTable);
                    if (FileList[0].Attributes.GetNamedItem("trackArtist") != null)
                    {
                        FormLib.PopulateTable(FormLib.TableTypes.OpenList, ref OpenListTable, FileList);
                    }
                    else
                    {
                        FormLib.PopulateTable(FormLib.TableTypes.Default, ref OpenListTable, FileList);
                    }
                    dgv_OpenList.DataSource = dv; //Bind the data to grid view
                }
                else //xml
                {
                }
                sr.Close();

                LastValidLoadedFileType = fi.Extension;

                OpenListPopulated = true;
                IsPreviewed       = false;
            }
            else
            {
                //error
            }
        }