Esempio n. 1
0
        public IMessageHandler CreateHandler(HttpContext context, CloseFunction closeFunction, SenderFunction sendFunction)
        {
            string id     = PathRegex.Match(context.Request.Path.Value).Groups[1].Value;
            var    device = inputDevices.Find(id);

            return(new InputDeviceFeedbackHandler(closeFunction, sendFunction, device));
        }
Esempio n. 2
0
        public ActionResult <InputDeviceInfo> GetInputDevice(string id)
        {
            var d = inputDevices.Find(id);

            if (d == null)
            {
                return(NotFound());
            }
            return(new InputDeviceInfo {
                Id = d.Id,
                Name = d.Name,
                DeviceApi = d.DeviceApi.ToString(),
                Sources = d.FindAllSources().Select(s => new InputDeviceSource {
                    Id = s.Id,
                    Name = s.Name,
                    Type = s.Type.ToString(),
                }).ToList(),
                Targets = d.FindAllTargets().Select(t => new InputDeviceTarget {
                    Id = t.Id,
                    Name = t.Name,
                    Type = "ForceFeedback",
                }).ToList(),
            });
        }