Example #1
0
        void Activate()
        {
            // TODO this is janky, it really should be more specific than relying on something user configurable.
            var keyStroke = _shortcutService.GetShortcuts()
                            .Where(tuple => tuple.Item2 == AppAction.ActivateApp)
                            .Select(tuple => tuple.Item1)
                            .FirstOrDefault();

            _shortcutService.TryRequestShortcut(keyStroke);
        }
Example #2
0
        public IHttpActionResult GetShortcuts(string query)
        {
            IEnumerable <ShortcutDto> result = null;

            var param    = JsonConvert.DeserializeObject <dynamic>(query);
            var userId   = param.userId.Value;
            var category = (ShortcutCategory)param.category.Value;

            result = _shortcutService.GetShortcuts(userId, category);

            return(Ok(result));
        }
Example #3
0
        public async Task <ApiResponse> GetShortcuts(string business_id, string access_token)
        {
            ApiResponse response = new ApiResponse();

            try
            {
                var resultData = await _shortcutService.GetShortcuts(business_id, 0, 10);

                response.ok   = true;
                response.data = resultData;
            }
            catch (Exception ex)
            {
                _logService.Create(new Log
                {
                    message  = ex.Message,
                    category = "Shortcut",
                    link     = $"{Request.HttpContext.Request.Scheme}://{Request.HttpContext.Request.Host}{Request.HttpContext.Request.Path}{Request.HttpContext.Request.QueryString}",
                    details  = JsonConvert.SerializeObject(ex.StackTrace),
                    name     = string.Format("Get shortcuts by business_id: {0}", business_id)
                });
            }
            return(response);
        }
Example #4
0
 private List <IShortcut> GetStartupShorcuts()
 => _shortcutService.GetShortcuts(StartupPath).ToList();