예제 #1
0
        private void SetNameFromCodePattern(int nameStartIndex)
        {
            if (nameStartIndex >= FileNameWithoutExtension.Length)
            {
                return;
            }

            Name = FileNameWithoutExtension.Remove(0, nameStartIndex).Trim();
        }
예제 #2
0
        private void SetNameFromFinalPattern(int startIndex)
        {
            string fileNameWE = FileNameWithoutExtension.ToLower();

            while (startIndex < fileNameWE.Length && fileNameWE[startIndex] == ' ')
            {
                startIndex++;
            }
            while (startIndex < fileNameWE.Length && fileNameWE[startIndex] == '-')
            {
                startIndex++;
            }
            while (startIndex < fileNameWE.Length && fileNameWE[startIndex] == ' ')
            {
                startIndex++;
            }

            if (startIndex >= fileNameWE.Length)
            {
                return;
            }

            Name = FileNameWithoutExtension.Remove(0, startIndex).TrimStart(' ').TrimEnd(' ');
        }