Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ internal class ProcessKillContext
public ProcessKillContext(IReadOnlyCollection<string> names)
{
Ensure.NotNull(names, "names");
ProcessNames = names;
targets = names.SelectMany(name => Process.GetProcessesByName(name)).ToList();
}

public IReadOnlyCollection<string> ProcessNames { get; }

public int ProcessCount { get => targets.Count; }

public bool IsExecutable => targets.Count > 0;

public void Execute()
Expand Down
7 changes: 5 additions & 2 deletions src/PackageManager.UI/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ private Task<bool> OnBeforeChange()
var context = processes.PrepareContextForProcessesKillBeforeChange();
if (context.IsExecutable)
{
var processNames = string.Join(" and ", context.ProcessNames);
if (context.ProcessCount > 1 || context.ProcessNames.Count > 1)
processNames = $"all instances of {processNames}";

bool result = navigator.Confirm(
"Plugin Manager",
"Plugin Manager is going to write to files that are holded by other executables. " + Environment.NewLine +
"Do you want to kill all instances of these applications?"
$"Plugin Manager will be writing to files that are currently in use.\r\n\r\nDo you want to stop {processNames}?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$"Plugin Manager will be writing to files that are currently in use.\r\n\r\nDo you want to stop {processNames}?"
$"Plugin Manager will be writing to files that are currently in use.\r\n\r\nDo you want to stop all instances of {processNames}?"

This is really just a detail and I have no strong feelings about it. At the end I accept both forms, with and without this suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no option. I'm not good at user texts, as I tend to put there too much information.
Think it's @RussKie's call 😎

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose if there's only a single instance of an app, than it is the first message. Else the second ;))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem 😎

);

if (result)
Expand Down