Skip to content
Merged
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 @@ -266,30 +266,17 @@ private void RetrieveProcessesByInput()
}

/// <summary>
/// Retrieve the master list of all processes.
/// Gets an array of all processes.
/// </summary>
/// <value></value>
/// <value>An array of <see cref="Process"/> components that represents all the process resources.</value>
/// <exception cref="System.Security.SecurityException">
/// MSDN does not document the list of exceptions,
/// but it is reasonable to expect that SecurityException is
/// among them. Errors here will terminate the cmdlet.
/// </exception>
internal Process[] AllProcesses
{
get
{
if (_allProcesses == null)
{
List<Process> processes = new();
processes.AddRange(Process.GetProcesses());
_allProcesses = processes.ToArray();
}

return _allProcesses;
}
}
internal Process[] AllProcesses => _allProcesses ??= Process.GetProcesses();

private Process[] _allProcesses = null;
private Process[] _allProcesses;

/// <summary>
/// Add <paramref name="process"/> to <see cref="_matchingProcesses"/>,
Expand Down