Streamline output path textbox handling

Addresses issue of cursor moving during typing
Addresses issue of extraneous spaces appearing
This commit is contained in:
Matt Nadareski
2021-04-12 13:25:12 -07:00
parent 7e73f69433
commit 4b7d4e05e7
2 changed files with 50 additions and 14 deletions

View File

@@ -246,7 +246,6 @@ namespace MPF.Data
// Cache if we had a directory separator or not
bool endedWithDirectorySeparator = directory.EndsWith(Path.DirectorySeparatorChar.ToString())
|| directory.EndsWith(Path.AltDirectorySeparatorChar.ToString());
bool endedWithSpace = directory.EndsWith(" ");
// Combine the path to make things separate easier
string combinedPath = Path.Combine(directory, filename);
@@ -271,10 +270,6 @@ namespace MPF.Data
if (replacePeriods)
filename = Path.GetFileNameWithoutExtension(filename).Replace('.', '_') + "." + Path.GetExtension(filename).TrimStart('.');
// If we had a space at the end before, add it again
if (endedWithSpace)
directory += " ";
// If we had a directory separator at the end before, add it again
if (endedWithDirectorySeparator)
directory += Path.DirectorySeparatorChar;