UiaControlsTest.TargetApp.TryOpenExisting C# (CSharp) Method

TryOpenExisting() public method

public TryOpenExisting ( ) : bool
return bool
        public bool TryOpenExisting()
        {
            var processName = Path.GetFileNameWithoutExtension(_cmdLine);
            var proc = Process.GetProcessesByName(processName).FirstOrDefault();
            if (proc != null)
            {
                _p = proc;
                return true;
            }
            return false;
        }