Ejemplo n.º 1
0
        public static List <UnmatchVW> GetUnMatch(bool includePlayed)
        {
            List <UnmatchVW> ret = new List <UnmatchVW>();

            var drivers = Environment.GetLogicalDrives();
            var folder  = "pt";

            foreach (var driver in drivers)
            {
                if (Directory.Exists(driver + "\\" + folder))
                {
                    List <FileInfo> fi    = new List <FileInfo>();
                    var             files = FileUtility.GetFilesRecursive(driver + "\\" + folder, formats, excludes, fi, 500);

                    foreach (var f in fi)
                    {
                        UnmatchVW temp = new UnmatchVW();
                        temp.FileName = f.Name.Replace(f.Extension, "");
                        temp.FilePath = f.FullName;
                        temp.FileSize = FileSize.GetAutoSizeString(f.Length, 2);
                        temp.FileExts = f.Extension;

                        if (ScanDataBaseManager.ViewedFile(FileUtility.ReplaceInvalidChar(f.FullName)))
                        {
                            temp.HasPlayed = true;
                        }

                        if (includePlayed)
                        {
                            ret.Add(temp);
                        }
                        else
                        {
                            if (temp.HasPlayed == false)
                            {
                                ret.Add(temp);
                            }
                        }
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 2
0
        private void ShowContent()
        {
            listView1.Items.Clear();

            listView1.BeginUpdate();
            foreach (var file in fi)
            {
                ListViewItem lvi = new ListViewItem(file.DirectoryName);
                lvi.SubItems.Add(file.Name);
                lvi.SubItems.Add(FileSize.GetAutoSizeString(file.Length, 1));
                lvi.Tag = file.FullName;

                if (ScanDataBaseManager.ViewedFile(FileUtility.ReplaceInvalidChar(file.FullName)))
                {
                    lvi.BackColor = Color.Green;
                }

                listView1.Items.Add(lvi);
            }
            listView1.EndUpdate();
        }