예제 #1
0
        private string RenameFile(string oldPath)
        {
            string newPath = new TaggedMediaFileRenamer(oldPath, remamePattern).GetNewPath(_wordCasing);

            FEFileTaskSupport support = new FEFileTaskSupport(null);

            FileInfo fi = new FileInfo(oldPath);
            List<string> linkedFiles = support.GetChildFiles(fi, FileTaskType.Move);

            File.Move(oldPath, newPath);

            if (linkedFiles != null)
            {
                string oldName = Path.GetFileNameWithoutExtension(oldPath);
                string newName = Path.GetFileNameWithoutExtension(newPath);

                foreach (string linkedFile in linkedFiles)
                {
                    string newLinkedFile = linkedFile.Replace(oldName, newName);
                    File.Move(linkedFile, StringUtils.Capitalize(newLinkedFile, _wordCasing));
                }
            }

            files[currentStep] = newPath;
            return Translator.Translate("TXT_SUCCESS");
        }
예제 #2
0
        List<string> OnQueryLinkedFiles(string path, FileTaskType taskType)
        {
            FEFileTaskSupport support = new FEFileTaskSupport(null);

            FileInfo fi = new FileInfo(path);
            if (fi != null && fi.Exists)
            {
                return support.GetChildFiles(fi, taskType);
            }

            return null;
        }