// PUT api/<controller>/5 public void Put(Guid id, [FromBody] DeviceDataFormat value) { if (value == null) { return; } var element = DeviceContext.Instance.DeviceDataFormats.Find(id); value.DeviceData = element.DeviceData; DeviceContext.Instance.DeviceDataFormats.AddOrUpdate(value); DeviceContext.Instance.SaveChanges(); }
public static DeviceDataFormatViewModel NewDeviceDataFormat(Guid id) { var data = DeviceContext.Instance.DeviceDatas.Find(id); var format = new DeviceDataFormat() { id = Guid.NewGuid(), nodeType = NodeType.Format, parentId = id, state = "open", DeviceData = data, index = data.DeviceDataFormats.Count, key = data.DeviceDataFormats.Count, value = "0" }; return(new DeviceDataFormatViewModel(format)); }
protected static void AcquireDirectInputDevice(IntPtr windowHandle, Device device, DeviceDataFormat format) { device.SetCooperativeLevel(windowHandle, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive); device.SetDataFormat(format); device.Acquire(); }
public void SetDataFormat(DeviceDataFormat df) { throw new NotImplementedException(); }
private DeviceDataFormatViewModel(DeviceDataFormat format) : base(format) { _deviceFormat = format; }
protected static void AcquireDirectInputDevice(IntPtr windowHandle, Device device, DeviceDataFormat format) { device.SetCooperativeLevel(windowHandle, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive); device.SetDataFormat(format); device.Acquire(); }