refactor
This commit is contained in:
@@ -36,7 +36,21 @@ public partial class NugetPanel : Control
|
||||
_implicitlyInstalledPackagesItemList.QueueFreeChildren();
|
||||
_availablePackagesItemList.QueueFreeChildren();
|
||||
|
||||
_solutionOrProjectOptionButton.ItemSelected += OnSolutionOrProjectSelected;
|
||||
_ = Task.GodotRun(_AsyncReady);
|
||||
}
|
||||
|
||||
private async Task _AsyncReady()
|
||||
{
|
||||
await _sharpIdeSolutionAccessor.SolutionReadyTcs.Task;
|
||||
_solution = _sharpIdeSolutionAccessor.SolutionModel;
|
||||
await this.InvokeAsync(() =>
|
||||
{
|
||||
foreach (var project in _solution!.AllProjects)
|
||||
{
|
||||
_solutionOrProjectOptionButton.AddIconItem(_csprojIcon, project.Name);
|
||||
}
|
||||
_solutionOrProjectOptionButton.ItemSelected += OnSolutionOrProjectSelected;
|
||||
});
|
||||
OnSolutionOrProjectSelected(0);
|
||||
}
|
||||
|
||||
@@ -44,18 +58,8 @@ public partial class NugetPanel : Control
|
||||
{
|
||||
_ = Task.GodotRun(async () =>
|
||||
{
|
||||
if (_solution is null)
|
||||
{
|
||||
await _sharpIdeSolutionAccessor.SolutionReadyTcs.Task;
|
||||
_solution = _sharpIdeSolutionAccessor.SolutionModel;
|
||||
}
|
||||
await this.InvokeAsync(() =>
|
||||
{
|
||||
foreach (var project in _solution!.AllProjects)
|
||||
{
|
||||
_solutionOrProjectOptionButton.AddIconItem(_csprojIcon, project.Name);
|
||||
}
|
||||
});
|
||||
if (_solution is null) throw new InvalidOperationException("Solution is null but should not be");
|
||||
|
||||
var result = await _nugetClientService.GetTop100Results(_solution!.DirectoryPath);
|
||||
|
||||
_ = Task.GodotRun(async () =>
|
||||
|
||||
Reference in New Issue
Block a user