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