コード例 #1
0
 public async void Execute(object parameter)
 {
     try {
         await ExcecuteAsync();
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #2
0
 public async Task PushMiddleButton(int x, int y)
 {
     try {
         await GetSingleMouseEventTask(x, y, MouseEvent.MiddleDown);
     }
     catch (TaskCanceledException) {
         throw;
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #3
0
 public async Task SetMousePos(int x, int y)
 {
     try {
         await GetSingleMouseEventTask(x, y, MouseEvent.Move);
     }
     catch (TaskCanceledException) {
         throw;
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #4
0
 public async Task WrileUserCustomLog(Dictionary <string, string> userCustomDic)
 {
     try {
         await Task.Run(() => Logger.WriteUserCustomAsync(userCustomDic), AppEnvironment.GetInstance().CancelToken);
     }
     catch (TaskCanceledException) {
         throw;
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #5
0
 public async Task Delay(int millsecond)
 {
     try {
         await Task.Delay(millsecond, AppEnvironment.GetInstance().CancelToken);
     }
     catch (TaskCanceledException) {
         throw;
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #6
0
 public async Task SetMode(byte mode)
 {
     try {
         await Task.Run(() => {
             AppEnvironment.GetInstance().Mode = ( ModeKind )mode;
         }, AppEnvironment.GetInstance().CancelToken);
     }
     catch (TaskCanceledException) {
         throw;
     }
     catch (Exception ex) {
         await CommonUtil.HandleExceptionAsync(ex);
     }
 }
コード例 #7
0
        public async Task ReleaseKey(ushort virtualKey)
        {
            try {
                var input = new List <KeyInput>
                {
                    CreateKeyInput(virtualKey, KeyEvent.KeyUp)
                };

                await SendKeyInput(input.ToArray());
            }
            catch (TaskCanceledException) {
                throw;
            }
            catch (Exception ex) {
                await CommonUtil.HandleExceptionAsync(ex);
            }
        }
コード例 #8
0
        public async Task HWheelMouse(int x, int y, int wheelRotate)
        {
            try {
                var input = new List <MouseInput>
                {
                    CreateMouseWheel(x, y, MouseEvent.Hwheel, wheelRotate),
                };

                await SendMouseInput(input.ToArray());
            }
            catch (TaskCanceledException) {
                throw;
            }
            catch (Exception ex) {
                await CommonUtil.HandleExceptionAsync(ex);
            }
        }