private static void watcherWindow_DeviceArrived(object sender, DeviceWindowEventArgs e) { foreach (char dr in e.Drives) { if (IsIpodDrive(dr)) { IPod.Device device = new IPod.Device(dr + ":\\"); devices.Add(dr, device); if (device_added != null) { device_added(null, new DeviceEventArgs(device)); } } } }
private static void watcherWindow_DeviceRemoved(object sender, DeviceWindowEventArgs e) { foreach (char dr in e.Drives) { if (devices.ContainsKey(dr)) { IPod.Device device = devices[dr]; devices.Remove(dr); if (device_removed != null) { device_removed(null, new DeviceEventArgs(device)); } } } }
private static void watcherWindow_DeviceRemoved(object sender, DeviceWindowEventArgs e) { foreach (char dr in e.Drives) if (devices.ContainsKey (dr)) { IPod.Device device = devices[dr]; devices.Remove (dr); if (device_removed != null) device_removed(null, new DeviceEventArgs(device)); } }
private static void watcherWindow_DeviceArrived(object sender, DeviceWindowEventArgs e) { foreach (char dr in e.Drives) { if (IsIpodDrive(dr)) { IPod.Device device = new IPod.Device(dr + ":\\"); devices.Add (dr, device); if (device_added != null) device_added (null, new DeviceEventArgs(device)); } } }