Пример #1
0
        public static bool IsProcessRunning(this IProcessProvider provider, string key)
        {
            var process = provider.GetProcess(key);

            if (process == null)
            {
                return(false);
            }

            return(!process.HasExited);
        }
Пример #2
0
 /// <summary>
 /// Starts a secondary process to safely kill the process with the specified key.
 /// Returns the process with the specified key, which you can then wait for to exit.
 /// </summary>
 public static Process SafelyKillProcess(this IProcessProvider provider, string key)
 {
     return(provider.SafelyKillProcess(provider.GetProcess(key)));
 }