open previously open files

This commit is contained in:
Matt Parker
2025-10-22 20:55:09 +10:00
parent 2e9598b217
commit aec76cc10e
4 changed files with 27 additions and 6 deletions

View File

@@ -81,8 +81,12 @@ public partial class IdeWindow : Control
return;
}
ideRoot.SetSlnFilePath(slnPath);
var recentSln = new RecentSln { FilePath = slnPath, Name = Path.GetFileName(slnPath) };
Singletons.AppState.RecentSlns.RemoveAll(s => s.FilePath == recentSln.FilePath); // Move to end (most recent)
var recentSln = Singletons.AppState.RecentSlns.SingleOrDefault(s => s.FilePath == slnPath);
if (recentSln is not null)
{
Singletons.AppState.RecentSlns.Remove(recentSln);
}
recentSln ??= new RecentSln { FilePath = slnPath, Name = Path.GetFileName(slnPath)};
Singletons.AppState.RecentSlns.Add(recentSln);
await this.InvokeAsync(() =>