mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
change foreach to select
This commit is contained in:
parent
49b657b84e
commit
b8a3ad8c42
1 changed files with 31 additions and 31 deletions
|
|
@ -90,24 +90,24 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
|
|
||||||
internal List<Result> RequestInstallOrUpdate(string searchName)
|
internal List<Result> RequestInstallOrUpdate(string searchName)
|
||||||
{
|
{
|
||||||
var results = new List<Result>();
|
var results =
|
||||||
|
pluginsManifest
|
||||||
pluginsManifest
|
|
||||||
.UserPlugins
|
.UserPlugins
|
||||||
.ForEach(x => results.Add(
|
.Select(x =>
|
||||||
new Result
|
new Result
|
||||||
|
{
|
||||||
|
Title = $"{x.Name} by {x.Author}",
|
||||||
|
SubTitle = x.Description,
|
||||||
|
IcoPath = icoPath,
|
||||||
|
Action = e =>
|
||||||
{
|
{
|
||||||
Title = $"{x.Name} by {x.Author}",
|
Application.Current.MainWindow.Hide();
|
||||||
SubTitle = x.Description,
|
InstallOrUpdate(x);
|
||||||
IcoPath = icoPath,
|
|
||||||
Action = e =>
|
|
||||||
{
|
|
||||||
Application.Current.MainWindow.Hide();
|
|
||||||
InstallOrUpdate(x);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}));
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
return Search(results, searchName);
|
return Search(results, searchName);
|
||||||
}
|
}
|
||||||
|
|
@ -156,23 +156,23 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
|
|
||||||
internal List<Result> RequestUninstall(string search)
|
internal List<Result> RequestUninstall(string search)
|
||||||
{
|
{
|
||||||
var results = new List<Result>();
|
var results= Context.API
|
||||||
|
.GetAllPlugins()
|
||||||
|
.Select(x =>
|
||||||
|
new Result
|
||||||
|
{
|
||||||
|
Title = $"{x.Metadata.Name} by {x.Metadata.Author}",
|
||||||
|
SubTitle = x.Metadata.Description,
|
||||||
|
IcoPath = x.Metadata.IcoPath,
|
||||||
|
Action = e =>
|
||||||
|
{
|
||||||
|
Application.Current.MainWindow.Hide();
|
||||||
|
Uninstall(x.Metadata);
|
||||||
|
|
||||||
Context.API.GetAllPlugins()
|
return true;
|
||||||
.ForEach(x => results.Add(
|
}
|
||||||
new Result
|
})
|
||||||
{
|
.ToList();
|
||||||
Title = $"{x.Metadata.Name} by {x.Metadata.Author}",
|
|
||||||
SubTitle = x.Metadata.Description,
|
|
||||||
IcoPath = x.Metadata.IcoPath,
|
|
||||||
Action = e =>
|
|
||||||
{
|
|
||||||
Application.Current.MainWindow.Hide();
|
|
||||||
Uninstall(x.Metadata);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
return Search(results, search);
|
return Search(results, search);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue