void OnDeviceUpdate(OmDeviceEventArgs e) { OmDevice device = e.Device; /* * if (!devices.ContainsKey(e.Device.DeviceId)) * { * devices[e.Device.DeviceId] = new Device(e.Device); * } * Device device = devices[e.Device.DeviceId]; */ if (DeviceUpdate != null) { DeviceUpdate(this, new DeviceEventArgs(device, e)); } }
void om_DeviceRemoved(object sender, OmDeviceEventArgs e) { Console.WriteLine("REMOVED: " + e.Device.DeviceId); OnDeviceUpdate(e); }
void om_DeviceAttached(object sender, OmDeviceEventArgs e) { Console.WriteLine("ATTACHED: " + e.Device.DeviceId); OnDeviceUpdate(e); }
void om_DeviceChanged(object sender, OmDeviceEventArgs e) { //Console.WriteLine("CHANGED: " + e.Device.DeviceId); OnDeviceUpdate(e); }
public DeviceEventArgs(OmDevice device, OmDeviceEventArgs omEvent) { Device = device; OmEvent = omEvent; }
void OnDeviceUpdate(OmDeviceEventArgs e) { OmDevice device = e.Device; /* if (!devices.ContainsKey(e.Device.DeviceId)) { devices[e.Device.DeviceId] = new Device(e.Device); } Device device = devices[e.Device.DeviceId]; */ if (DeviceUpdate != null) { DeviceUpdate(this, new DeviceEventArgs(device, e)); } }