Exemplo n.º 1
0
        private void PrintDeviceInfo(string aPrologue, CpDevice aDevice)
        {
            string location;

            aDevice.GetAttribute("Upnp.Location", out location);
            string friendlyName;

            aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName);
            Console.Write(aPrologue +
                          "\n    udn = " + aDevice.Udn() +
                          "\n    location = " + location +
                          "\n    name = " + friendlyName + "\n");
        }
Exemplo n.º 2
0
 private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice)
 {
     lock (this)
     {
         string udn   = aDevice.Udn();
         int    count = iDeviceList.Count;
         for (int i = 0; i < count; i++)
         {
             if (iDeviceList[i].Udn() == udn)
             {
                 iDeviceList.RemoveAt(i);
                 iDeviceList[i].RemoveRef();
             }
         }
     }
 }
Exemplo n.º 3
0
        private void InvokeSync()
        {
            // trivial validation of the sync wrappers to all APIs
            // single sync call to whichever device happens to be first in our list
            if (iDeviceList.Count == 0)
            {
                Console.Write("No devices found, so nothing to test\n");
                return;
            }
            CpDevice device = iDeviceList[0];

            Console.Write("\n\nSync call to device " + device.Udn() + "\n");
            CpProxyUpnpOrgConnectionManager1 connMgr = new CpProxyUpnpOrgConnectionManager1(device);
            string source;
            string sink;

            connMgr.SyncGetProtocolInfo(out source, out sink);
            Console.Write("source is " + source + "\nsink is " + sink + "\n");
            connMgr.Dispose();
        }