コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 public CpDeviceDiagnosticsReport(CpDeviceDiagnostics aDevice)
     : base(aDevice)
 {
 }
コード例 #7
0
 public CpDeviceDiagnosticsProxyCdPlayer(CpDeviceDiagnostics aDevice)
     : base(aDevice)
 {
 }
コード例 #8
0
 public CpDeviceDiagnosticsItem(CpDeviceDiagnostics aDevice)
 {
     iDevice          = aDevice;
     iDevice.Changed += HandleChanged;
 }
コード例 #9
0
 public CpDeviceDiagnosticsProxyPreamp(CpDeviceDiagnostics aDevice)
     : base(aDevice)
 {
 }