using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Threading;

namespace IControls_FireManager
{
    public static class _Diagnostics
    {
        // 프로세스 삭제
        public static void Process_Delete(string ProcessName, bool ThreadSleep)
        {
            Process[] mProcess = Process.GetProcessesByName(ProcessName);
            foreach (Process p in mProcess) // 동일한 이름의 프로세스들을 모두 삭제
                p.Kill();

            if(ThreadSleep==true)
                Thread.Sleep(1000);
        }

        // 프로세스 실행여부
        public static bool Process_Excute(string ProcessName)
        {
            bool result = false;

            Process[] mProcess = Process.GetProcessesByName(ProcessName);

            if (mProcess.Length == 0) result = false;
            else result = true;

            return result;
        }
    }
}