Beispiel #1
0
        private static List <ExtractorResult> extractFolderInternal(FileSystemInfo[] FSInfo)
        {
            List <ExtractorResult> result = new List <ExtractorResult>();

            if (FSInfo == null)
            {
                return(result);
            }

            foreach (FileSystemInfo info in FSInfo)
            {
                if (info is DirectoryInfo)
                {
                    DirectoryInfo dInfo = (DirectoryInfo)info;
                    result.AddRange(extractFolderInternal(dInfo.GetFileSystemInfos()));
                }
                if (info is FileInfo)
                {
                    FileInfo        dInfo = (FileInfo)info;
                    ExtractorResult eRes  = extractOne(dInfo.FullName);
                    if (eRes != null)
                    {
                        result.Add(eRes);
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
        private void updateFileView(object sender, ProgressChangedEventArgs e)
        {
            if (e.UserState != null)
            {
                ExtractorResult         er          = e.UserState as ExtractorResult;
                DataGridViewRow         row         = new DataGridViewRow();
                DataGridViewTextBoxCell oriFilename = new DataGridViewTextBoxCell();
                oriFilename.Value = Path.GetFileName(er.filePath);
                row.Cells.Add(oriFilename);
                DataGridViewTextBoxCell changedFilename = new DataGridViewTextBoxCell();
                changedFilename.Value = Path.GetFileName(er.destName);
                row.Cells.Add(changedFilename);
                FileView.Rows.Add(row);
            }

            if (e.ProgressPercentage == 100)
            {
                SmartMove.Enabled = true;
            }
        }
Beispiel #3
0
        public static ExtractorResult extractOne(string path)
        {
            ExtractorResult result = new ExtractorResult();

            if (!File.Exists(path))
            {
                return(null);
            }

            string externs = Path.GetExtension(path);

            if (!videoExtensions.Contains(Path.GetExtension(path), new CaseIgnoreComparer()))
            {
                return(null);
            }

            result.filePath     = path;
            result.fileName     = Path.GetFileNameWithoutExtension(path);
            result.possibleCode = extract(result.fileName);

            return(result);
        }