/// <summary>
/// Get information of the process name
/// </summary>
/// <param>Process to get information about</param>
/// <returns></returns>
public static string GetInformation(this Process Process)
{
return Process.ProcessName;
}
/// <summary>
/// Gets information about all processes and returns it in string
/// </summary>
/// <param>Processes to get information about</param>
/// <returns>string</returns>
public static string GetInformation(this IEnumerable<Process> Processes)
{
StringBuilder Builder = new StringBuilder();
Processes.ForEach(x => Builder.Append(x.GetInformation()));
return Builder.ToString();
}
#endregion
#endregion
#region Private Static Functions
/// <summary>
/// Kills a process asyncronously
/// </summary>
/// <param>Name of the process to kill</param>
/// <param>Amount of time until the process is killed</param>
private static void KillProcessAsyncHelper(Process Process, int TimeToKill)
{
if (TimeToKill > 0)
Thread.Sleep(TimeToKill);
Process.Kill();
}
#endregion
}