File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,14 @@ internal class ProcessKillContext
1818 public ProcessKillContext ( IReadOnlyCollection < string > names )
1919 {
2020 Ensure . NotNull ( names , "names" ) ;
21+ ProcessNames = names ;
2122 targets = names . SelectMany ( name => Process . GetProcessesByName ( name ) ) . ToList ( ) ;
2223 }
2324
25+ public IReadOnlyCollection < string > ProcessNames { get ; }
26+
27+ public int ProcessCount { get => targets . Count ; }
28+
2429 public bool IsExecutable => targets . Count > 0 ;
2530
2631 public void Execute ( )
Original file line number Diff line number Diff line change @@ -51,10 +51,13 @@ private Task<bool> OnBeforeChange()
5151 var context = processes . PrepareContextForProcessesKillBeforeChange ( ) ;
5252 if ( context . IsExecutable )
5353 {
54+ var processNames = string . Join ( " and " , context . ProcessNames ) ;
55+ if ( context . ProcessCount > 1 || context . ProcessNames . Count > 1 )
56+ processNames = $ "all instances of { processNames } ";
57+
5458 bool result = navigator . Confirm (
5559 "Plugin Manager" ,
56- "Plugin Manager is going to write to files that are holded by other executables. " + Environment . NewLine +
57- "Do you want to kill all instances of these applications?"
60+ $ "Plugin Manager will be writing to files that are currently in use.\r \n \r \n Do you want to stop { processNames } ?"
5861 ) ;
5962
6063 if ( result )
You can’t perform that action at this time.
0 commit comments