public async void Execute(object parameter) { try { await ExcecuteAsync(); } catch (Exception ex) { await CommonUtil.HandleExceptionAsync(ex); } }
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); } }
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); } }
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); } }
public async Task Delay(int millsecond) { try { await Task.Delay(millsecond, AppEnvironment.GetInstance().CancelToken); } catch (TaskCanceledException) { throw; } catch (Exception ex) { await CommonUtil.HandleExceptionAsync(ex); } }
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); } }
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); } }
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); } }