feat: reordering
This commit is contained in:
@@ -104,8 +104,9 @@ namespace CarManagerV3
|
||||
}
|
||||
MessageBox.Show($"Warning: {failedLines.Count} lines in the file could not be parsed and were skipped. Check the console for details.", "Parsing Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
cars = StateManager.normalizeOrders(cars);
|
||||
cars = cars.OrderBy(c => c.Order).ToList();
|
||||
if(isLegacy)
|
||||
if (isLegacy)
|
||||
{
|
||||
SafeManager.SaveCars(path, cars);
|
||||
}
|
||||
@@ -213,6 +214,25 @@ namespace CarManagerV3
|
||||
return paths;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder of the most recently opened file, or the users documents folder if no recent files.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string getRecentFolder()
|
||||
{
|
||||
List<string> recentPaths = GetRecentPaths();
|
||||
if (recentPaths.Count > 0)
|
||||
{
|
||||
string recentFile = recentPaths[0];
|
||||
if (File.Exists(recentFile))
|
||||
{
|
||||
return Path.GetDirectoryName(recentFile);
|
||||
}
|
||||
}
|
||||
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user