Beispiel #1
0
 private void StopControlPoint(UpnpSmartControlPoint controlPoint)
 {
     controlPoint.ShutDown();
     controlPoint.OnAddedDevice   -= controPoint_OnAddedDevice;
     controlPoint.OnRemovedDevice -= controPoint_OnRemovedDevice;
     controlPoint.OnDeviceExpired -= controPoint_OnDeviceExpired;
     controlPoint = null;
 }
Beispiel #2
0
 private void controPoint_OnAddedDevice(UpnpSmartControlPoint sender, UPnPDevice device)
 {
     if (device.StandardDeviceType == "MediaRenderer")
     {
         UPnPService service = device.GetService("AVTransport");
         if (service != null)
         {
             this.Dispatcher.BeginInvoke((Action)(() => {
                 this.deviceList.Items.Add(device);
             }));
         }
     }
 }
Beispiel #3
0
        private void StartControlPoint()
        {
            //添列表
            this.deviceList.Items.Clear();

            if (this.smart != null)
            {
                StopControlPoint(this.smart);
            }

            this.smart = new UpnpSmartControlPoint();
            this.smart.OnAddedDevice   += controPoint_OnAddedDevice;
            this.smart.OnRemovedDevice += controPoint_OnRemovedDevice;
            this.smart.OnDeviceExpired += controPoint_OnDeviceExpired;
        }
Beispiel #4
0
 private void controPoint_OnDeviceExpired(UpnpSmartControlPoint sender, UPnPDevice device)
 {
     //this.deviceList.Items.Remove(device);
 }