private void Added(CpDeviceList aList, CpDevice aDevice) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsList: Device+ Udn{" + aDevice.Udn() + "}"); string version; if (!aDevice.GetAttribute("Upnp.Service.av-openhome-org.Product", out version)) { return; } CpDeviceDiagnostics device = new CpDeviceDiagnostics(aDevice, DiagnosticsAdded); lock (iLock) { if (iDisposed) { return; } // check to see if device has been added immediately if (!iDeviceListDiagnostics.Contains(device)) { iDeviceListPending.Add(device); } } }
private void Added(CpDeviceDiagnosticsList aList, CpDeviceDiagnostics aDevice) { List <CpDeviceDiagnosticsItem> devices = new List <CpDeviceDiagnosticsItem>(); lock (iLock) { if (iDisposed) { return; } CpDeviceDiagnosticsItem device; if (aDevice.CrashDataStatus == CpDeviceDiagnostics.ECrashDataStatus.eAvailable) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsReportList: DeviceDiagnosticsReport+ Udn{" + aDevice.Udn + "}"); device = new CpDeviceDiagnosticsReport(aDevice); device.Changed += HandleChanged; devices.Add(device); iDeviceListDiagnosticsItem.Add(device); } if (aDevice.CdPlayerProblem) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsReportList: DeviceDiagnosticsProxyCdPlayer+ Udn{" + aDevice.Udn + "}"); device = new CpDeviceDiagnosticsProxyCdPlayer(aDevice); device.Changed += HandleChanged; devices.Add(device); iDeviceListDiagnosticsItem.Add(device); } if (aDevice.PreampProblem) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsReportList: DeviceDiagnosticsProxyPreamp+ Udn{" + aDevice.Udn + "}"); device = new CpDeviceDiagnosticsProxyPreamp(aDevice); device.Changed += HandleChanged; devices.Add(device); iDeviceListDiagnosticsItem.Add(device); } } foreach (CpDeviceDiagnosticsItem d in devices) { if (iAdded != null) { iAdded(this, d); } } }
private void Removed(CpDeviceList aList, CpDevice aDevice) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsList: Device- Udn{" + aDevice.Udn() + "}"); CpDeviceDiagnostics device = null; lock (iLock) { if (iDisposed) { return; } foreach (CpDeviceDiagnostics d in iDeviceListPending) { if (d.Udn == aDevice.Udn()) { iDeviceListPending.Remove(d); d.Dispose(); return; } } foreach (CpDeviceDiagnostics d in iDeviceListDiagnostics) { if (d.Udn == aDevice.Udn()) { device = d; iDeviceListDiagnostics.Remove(device); break; } } } if (device != null) { if (iRemoved != null) { iRemoved(this, device); } device.Dispose(); } }
private void DiagnosticsAdded(CpDeviceDiagnostics aDevice) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsList: DeviceDiagnostics+ Udn{" + aDevice.Udn + "}"); lock (iLock) { if (iDisposed) { aDevice.Dispose(); return; } iDeviceListPending.Remove(aDevice); iDeviceListDiagnostics.Add(aDevice); } if (iAdded != null) { iAdded(this, aDevice); } }
private void Removed(CpDeviceDiagnosticsList aList, CpDeviceDiagnostics aDevice) { List <CpDeviceDiagnosticsItem> devices = new List <CpDeviceDiagnosticsItem>(); lock (iLock) { if (iDisposed) { return; } foreach (CpDeviceDiagnosticsItem d in iDeviceListDiagnosticsItem) { if (d.Udn == aDevice.Udn) { UserLog.WriteLine(DateTime.Now + ": CpDeviceDiagnosticsReportList: DeviceDiagnosticsItem- Udn{" + aDevice.Udn + "}"); devices.Add(d); d.Changed -= HandleChanged; } } foreach (CpDeviceDiagnosticsItem d in devices) { iDeviceListDiagnosticsItem.Remove(d); } } foreach (CpDeviceDiagnosticsItem d in devices) { if (iRemoved != null) { iRemoved(this, d); } d.Dispose(); } }
public CpDeviceDiagnosticsReport(CpDeviceDiagnostics aDevice) : base(aDevice) { }
public CpDeviceDiagnosticsProxyCdPlayer(CpDeviceDiagnostics aDevice) : base(aDevice) { }
public CpDeviceDiagnosticsItem(CpDeviceDiagnostics aDevice) { iDevice = aDevice; iDevice.Changed += HandleChanged; }
public CpDeviceDiagnosticsProxyPreamp(CpDeviceDiagnostics aDevice) : base(aDevice) { }