@@ -138,34 +138,33 @@ on existingPlugin.Metadata.ID equals pluginFromManifest.ID
138
138
var results = resultsForUpdate
139
139
. Select ( x =>
140
140
new Result
141
+ {
142
+ Title = $ "{ x . Name } by { x . Author } ",
143
+ SubTitle = $ "Update from version { x . CurrentVersion } to { x . NewVersion } ",
144
+ IcoPath = x . IcoPath ,
145
+ Action = e =>
141
146
{
142
- Title = $ "{ x . Name } by { x . Author } ",
143
- SubTitle = $ "Update from version { x . CurrentVersion } to { x . NewVersion } ",
144
- IcoPath = x . IcoPath ,
145
- Action = e =>
146
- {
147
- string message = string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_prompt" ) ,
148
- x . Name , x . Author ,
149
- Environment . NewLine , Environment . NewLine ) ;
150
-
151
- if ( MessageBox . Show ( message , Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
152
- MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
153
- {
154
- Uninstall ( x . PluginExistingMetadata ) ;
147
+ string message = string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_prompt" ) ,
148
+ x . Name , x . Author ,
149
+ Environment . NewLine , Environment . NewLine ) ;
155
150
156
- var downloadToFilePath = Path . Combine ( DataLocation . PluginsDirectory , $ "{ x . Name } -{ x . NewVersion } .zip") ;
157
- Http . Download ( x . PluginNewUserPlugin . UrlDownload , downloadToFilePath ) ;
158
- Install ( x . PluginNewUserPlugin , downloadToFilePath ) ;
151
+ if ( MessageBox . Show ( message , Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
152
+ MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
153
+ {
154
+ Uninstall ( x . PluginExistingMetadata ) ;
159
155
160
- Context . API . RestartApp ( ) ;
156
+ var downloadToFilePath = Path . Combine ( DataLocation . PluginsDirectory , $ "{ x . Name } -{ x . NewVersion } .zip") ;
157
+ Http . Download ( x . PluginNewUserPlugin . UrlDownload , downloadToFilePath ) ;
158
+ Install ( x . PluginNewUserPlugin , downloadToFilePath ) ;
161
159
162
- return true ;
163
- }
160
+ Context . API . RestartApp ( ) ;
164
161
165
- return false ;
162
+ return true ;
166
163
}
167
- } )
168
- . ToList ( ) ;
164
+
165
+ return false ;
166
+ }
167
+ } ) ;
169
168
170
169
return Search ( results , uninstallSearch ) ;
171
170
}
@@ -175,10 +174,10 @@ internal bool PluginExists(string id)
175
174
return Context . API . GetAllPlugins ( ) . Any ( x => x . Metadata . ID == id ) ;
176
175
}
177
176
178
- internal List < Result > Search ( List < Result > results , string searchName )
177
+ internal List < Result > Search ( IEnumerable < Result > results , string searchName )
179
178
{
180
179
if ( string . IsNullOrEmpty ( searchName ) )
181
- return results ;
180
+ return results . ToList ( ) ;
182
181
183
182
return results
184
183
. Where ( x =>
@@ -211,8 +210,7 @@ internal List<Result> RequestInstallOrUpdate(string searchName)
211
210
return ShouldHideWindow ;
212
211
} ,
213
212
ContextData = x
214
- } )
215
- . ToList ( ) ;
213
+ } ) ;
216
214
217
215
return Search ( results , searchName ) ;
218
216
}
@@ -265,7 +263,7 @@ internal List<Result> RequestUninstall(string search)
265
263
266
264
var uninstallSearch = search . Replace ( Settings . HotkeyUninstall , string . Empty ) . TrimStart ( ) ;
267
265
268
- var results = Context . API
266
+ var results = Context . API
269
267
. GetAllPlugins ( )
270
268
. Select ( x =>
271
269
new Result
@@ -291,8 +289,7 @@ internal List<Result> RequestUninstall(string search)
291
289
292
290
return false ;
293
291
}
294
- } )
295
- . ToList ( ) ;
292
+ } ) ;
296
293
297
294
return Search ( results , uninstallSearch ) ;
298
295
}
0 commit comments