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);
            }
        }