Added method to add recent project with pruning
This commit is contained in:
parent
085efa3c52
commit
bf9dec6248
@ -33,6 +33,18 @@ public partial class LoaderStart : UserControl
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateRecentProjectsWithPruning(string latestUsedProjectPath)
|
||||
{
|
||||
var previousRecentList = LoaderStart.RecentProjects;
|
||||
previousRecentList.Insert(0, latestUsedProjectPath);
|
||||
if (previousRecentList.Count > 6)
|
||||
previousRecentList = previousRecentList.Take(6).ToList();
|
||||
|
||||
LoaderStart.RecentProjects = previousRecentList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void buttonOpen_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(this.areRecentProjectsVisible)
|
||||
@ -60,10 +72,15 @@ public partial class LoaderStart : UserControl
|
||||
private void browseForProject()
|
||||
{
|
||||
// TODO: Browse for project
|
||||
|
||||
// TODO: Apply new project's path
|
||||
LoaderStart.UpdateRecentProjectsWithPruning(string.Empty);
|
||||
|
||||
// TODO: Open the project
|
||||
// TODO: Handle cancel event
|
||||
// TODO: Add the project to the recent projects
|
||||
// TODO: Prune the recent project list
|
||||
|
||||
// TODO: Apply chosen project's path
|
||||
LoaderStart.UpdateRecentProjectsWithPruning(string.Empty);
|
||||
}
|
||||
|
||||
private void openRecentProject(object? sender)
|
||||
@ -74,6 +91,8 @@ public partial class LoaderStart : UserControl
|
||||
if (sender is ToolStripItem item)
|
||||
{
|
||||
var path = (item.Tag as string)!;
|
||||
LoaderStart.UpdateRecentProjectsWithPruning(path);
|
||||
|
||||
// TODO: Open the project
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user