private bool Execute(AddDeviceCommand command) { var aggregateEvent = new DeviceAddedEvent(command.SerialNumber, command.IpAddress); Emit(aggregateEvent); return(true); }
private void DeviceInsertedEvent(object sender, EventArrivedEventArgs e) { try { Dictionary <string, string> properties = new Dictionary <string, string>(); ManagementBaseObject instance = (ManagementBaseObject)e.NewEvent["TargetInstance"]; foreach (var p in instance.Properties) { if (p.Value != null) { properties.Add(p.Name, p.Value.ToString()); } } DeviceAddedEvent?.Invoke(properties); } catch (PDException ex) { throw new PDException("invalid device inserted", ex); } }
private void AudioControllerOnDeviceAdded(object sender, DeviceAddedEvent deviceAddedEvent) { _needUpdate = true; }
private static void BindDevice(object sender, DeviceAddedEvent e) { (e.Device as TempSensorDS18B20).TemperatureUpdated += Device_TemperatureUpdated; }
private void Bus_DeviceAdded(object sender, DeviceAddedEvent e) { // if (e.Device.Type == DeviceType.DS18B20) // this.AddDevice(e.Device as TempSensorDS18B20); }
public void Apply(DeviceAddedEvent aggregateEvent) { ipAddress = aggregateEvent.IpAddress; serialNumber = aggregateEvent.SerialNumber; }
private void AudioController_DeviceAdded(object sender, DeviceAddedEvent e) { RefreshDevices(); }