private void ShutdownProcesses()
{
Parallel.ForEach(this.Config.Startup.ProcessSettings, new ParallelOptions() { MaxDegreeOfParallelism = 8 }, item =>
{
foreach (var p in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(item.Path)))
{
try
{
if (p.MainModule.FileName == Path.GetFullPath(item.Path))
{
try
{
p.Kill();
p.WaitForExit();
}
catch (Exception)
{
}
}
}
catch (Exception)
{
}
}
});
}