@@ -90,24 +90,24 @@ internal List<Result> Search(List<Result> results, string searchName)
90
90
91
91
internal List < Result > RequestInstallOrUpdate ( string searchName )
92
92
{
93
- var results = new List < Result > ( ) ;
94
-
95
- pluginsManifest
93
+ var results =
94
+ pluginsManifest
96
95
. UserPlugins
97
- . ForEach ( x => results . Add (
98
- new Result
96
+ . Select ( x =>
97
+ new Result
98
+ {
99
+ Title = $ "{ x . Name } by { x . Author } ",
100
+ SubTitle = x . Description ,
101
+ IcoPath = icoPath ,
102
+ Action = e =>
99
103
{
100
- Title = $ "{ x . Name } by { x . Author } ",
101
- SubTitle = x . Description ,
102
- IcoPath = icoPath ,
103
- Action = e =>
104
- {
105
- Application . Current . MainWindow . Hide ( ) ;
106
- InstallOrUpdate ( x ) ;
107
-
108
- return true ;
109
- }
110
- } ) ) ;
104
+ Application . Current . MainWindow . Hide ( ) ;
105
+ InstallOrUpdate ( x ) ;
106
+
107
+ return true ;
108
+ }
109
+ } )
110
+ . ToList ( ) ;
111
111
112
112
return Search ( results , searchName ) ;
113
113
}
@@ -156,23 +156,23 @@ private void Install(UserPlugin plugin, string downloadedFilePath)
156
156
157
157
internal List < Result > RequestUninstall ( string search )
158
158
{
159
- var results = new List < Result > ( ) ;
160
-
161
- Context . API . GetAllPlugins ( )
162
- . ForEach ( x => results . Add (
163
- new Result
164
- {
165
- Title = $ " { x . Metadata . Name } by { x . Metadata . Author } " ,
166
- SubTitle = x . Metadata . Description ,
167
- IcoPath = x . Metadata . IcoPath ,
168
- Action = e =>
169
- {
170
- Application . Current . MainWindow . Hide ( ) ;
171
- Uninstall ( x . Metadata ) ;
172
-
173
- return true ;
174
- }
175
- } ) ) ;
159
+ var results = Context . API
160
+ . GetAllPlugins ( )
161
+ . Select ( x =>
162
+ new Result
163
+ {
164
+ Title = $ " { x . Metadata . Name } by { x . Metadata . Author } " ,
165
+ SubTitle = x . Metadata . Description ,
166
+ IcoPath = x . Metadata . IcoPath ,
167
+ Action = e =>
168
+ {
169
+ Application . Current . MainWindow . Hide ( ) ;
170
+ Uninstall ( x . Metadata ) ;
171
+
172
+ return true ;
173
+ }
174
+ } )
175
+ . ToList ( ) ;
176
176
177
177
return Search ( results , search ) ;
178
178
}
0 commit comments