コード例 #1
0
        public void AquireFocus()
        {
            try
            {
                ReleaseFocus();

                Debug("Aquiring focus...");
                WinBioErrorCode result = WinBio.AcquireFocus();
                Debug(result.ToString());
                if (result == WinBioErrorCode.Ok)
                {
                    UpdateStatus(Statuses.Listening);
                }
                else
                {
                    throw new Exception("Non-OK response trying to aquire focus.");
                }
            }
            catch (Exception e)
            {
                Debug("Error aquiring focus");
                Debug(e.Message);
                UpdateStatus(Statuses.NoFocus);
            }
        }
コード例 #2
0
        public bool ReleaseFocus()
        {
            Debug("Releasing focus...");

            try
            {
                WinBioErrorCode result = WinBio.ReleaseFocus();
                Debug(result.ToString());
                if (result == WinBioErrorCode.Ok)
                {
                    UpdateStatus(Statuses.NoFocus);
                }

                return(result == WinBioErrorCode.Ok);
            }
            catch (Exception)
            {
                return(false);
            }
        }
コード例 #3
0
 public WinBioException(WinBioErrorCode errorCode)
     : base(errorCode.ToString())
 {
     ErrorCode = errorCode;
 }
コード例 #4
0
 public WinBioException(WinBioErrorCode errorCode)
     : base(errorCode.ToString())
 {
     ErrorCode = errorCode;
 }