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

            FEFileTaskSupport support = new FEFileTaskSupport(null);

            List <string> linkedFiles = support.GetChildFiles(oldPath, 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"));
        }
Example #2
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");
        }