Ejemplo n.º 1
0
        public static string GetNewFolder(string folderpath)
        {
            List <string> keywords = new List <string>();

            string directoryname = Path.GetFileNameWithoutExtension(folderpath);

            directoryname = directoryname.Replace('_', ' ');
            directoryname = RemoveBracket(directoryname);
            string[] words = directoryname.Split(new char[] { ' ' });
            foreach (string word in words)
            {
                string w = FolderParser.GetNormalWord(word, false);
                if (string.IsNullOrEmpty(w) == false && w != "-" && w.ToUpper() != "COPY")
                {
                    keywords.Add(w);
                }
            }
            return(Path.Combine(Path.GetDirectoryName(folderpath), StringJoin(" ", keywords)));
        }
Ejemplo n.º 2
0
        public static FileFolderKey GetKey(string folderpath)
        {
            List <string> keywords = new List <string>();

            string directoryname = Path.GetFileNameWithoutExtension(folderpath);

            directoryname = directoryname.Replace('_', ' ');
            directoryname = RemoveBracket(directoryname);
            string[] words = directoryname.Split(new char[] { ' ' });
            foreach (string word in words)
            {
                string w = FolderParser.GetNormalWord(word);
                if (string.IsNullOrEmpty(w) == false && w != "-" && w.ToUpper() != "COPY")
                {
                    keywords.Add(w);
                }
            }
            return(new FileFolderKey {
                Keywords = keywords, FolderShortName = Path.GetFileName(folderpath), FolderName = folderpath
            });
        }