/// <summary> /// Checks wether user already selected sufle option and builds playlist from folder selected. /// </summary> /// <param name="shufled"></param> /// <returns>PlayList</returns> public static PlayList BuildPlayList(bool shufled) { PlayList list = null; FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == DialogResult.OK) { string path = dialog.SelectedPath; DirectoryInfo dInfo = new DirectoryInfo(path); // File info docs FileInfo[] fInfor = dInfo.GetFiles("*.mp3"); list = new PlayList(fInfor); if (list.getPlayListSize() == 0) { return(null); } if (shufled) { list.shufleQueue(); } } return(list); }