private void SetNameFromCodePattern(int nameStartIndex) { if (nameStartIndex >= FileNameWithoutExtension.Length) { return; } Name = FileNameWithoutExtension.Remove(0, nameStartIndex).Trim(); }
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(' '); }