Ejemplo n.º 1
0
        public void OpenHomeDetails(Suburb suburb)
        {
            foreach (var url in homeUrlList)
            {
                driver.Navigate().GoToUrl(url);
                string location = driver.FindElement(By.XPath("//th[contains(text(),'Location:')]/following::td[1]")).Text;
                //There is soft hyphen presented in city name. To avoid that use the below line, first replace with '~' and then replace with ""
                location = location.Replace((char)173, '~').Replace("~", "");
                string rooms        = driver.FindElement(By.XPath("//th[contains(text(),'Rooms:')]/following::td[1]")).Text;
                string propertyType = driver.FindElement(By.XPath("//th[contains(text(),'Property type:')]/following::td[1]")).Text;

                OpenHome home = new OpenHome();

                home.Location     = location;
                home.Rooms        = rooms;
                home.PropertyType = propertyType;
                home.Price        = Price();
                home.Parking      = Parking();
                home.OpenHomeTime = OpenHomeTimes();
                suburb.HomeList.Add(home);
            }
            homeUrlList.Clear();
        }
Ejemplo n.º 2
0
 private void LogError(OpenHome.Net.ControlPoint.ProxyError err)
 {
     Utils.Logger.Log(Utils.Logger.Level.Error, "Can't invoke an action on remote device. Device says: (" + err.Code + ") " + err.Description);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Prints some device information.
 /// </summary>
 /// <param name="aPrologue"></param>
 /// <param name="aDevice"></param>
 private void PrintDeviceInfo(string aPrologue, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     string location;
     aDevice.GetAttribute("Upnp.Location", out location);
     string friendlyName;
     aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName);
     Utils.Logger.Log(Utils.Logger.Level.Debug,
         aPrologue +
         "\n    udn = " + aDevice.Udn() +
         "\n    location = " + location +
         "\n    name = " + friendlyName
     );
 }
Ejemplo n.º 4
0
        public UPnPDevice(OpenHome.Net.ControlPoint.CpDevice device, XmlDocument xmlDeviceDescr)
        {
            isStaring = true;

            device.AddRef();
            iDevice = device;

            xmlDeviceDescription = xmlDeviceDescr;

            avTransport = new OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgAVTransport1(iDevice);
            avRenderingControl = new OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgRenderingControl1(iDevice);

            SubscribeToDeviceEvents();

            GetPositionInfo();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Request an invocation object prior to setting input/output arguments
 /// </summary>
 /// <param name="aAction">Action which will be invoked</param>
 /// <param name="aCallback">Delegate to run when the action completes</param>
 /// <returns>Invocation object, ready to receive input and output arguments</returns>
 public Invocation Invocation(OpenHome.Net.Core.Action aAction, CpProxy.CallbackAsyncComplete aCallback)
 {
     Invocation invocation = new Invocation(this, aAction.Handle(), aCallback);
     lock (this)
     {
         iActiveInvocations.Add(invocation);
     }
     return invocation;
 }
Ejemplo n.º 6
0
 protected void ConfigServiceFoundSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     String name;
         aDevice.GetAttribute("Upnp.FriendlyName", out name);
         if (name == "Raumfeld ConfigDevice") // Only until find works correct!
         {
             CpConfigService configService = new CpConfigService_OhNet(aDevice);
             this.ConfigServiceFoundSink(configService);
         }
 }
Ejemplo n.º 7
0
        public CpConfigService_OhNet(OpenHome.Net.ControlPoint.CpDevice _configDevice)
        {
            _configDevice.GetAttribute("Upnp.FriendlyName", out FriendlyName);
                _configDevice.GetAttribute("Upnp.DeviceXml", out DeviceXml);
                _configDevice.GetAttribute("Upnp.Location", out Location);

                configService = new OpenHome.Net.ControlPoint.Proxies.CpProxyRaumfeldComConfigService1(_configDevice);
                //configService.SetPropertyInitialEvent(propertyChanged);
                configService.SetPropertyChanged(propertyChanged);
                configService.SetPropertyLastChangeChanged(propertyChanged);

                configService.Subscribe();
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Add a property to this provider
 /// </summary>
 /// <remarks>Any later updates to the value of the property will be automatically published to
 /// any subscribers</remarks>
 /// <param name="aProperty">Property being added</param>
 protected void AddProperty(OpenHome.Net.Core.Property aProperty)
 {
     iProperties.Add(aProperty);
     DvProviderAddProperty(iHandle, aProperty.Handle());
 }
Ejemplo n.º 9
0
        public CpAVConnection_OhNet(OpenHome.Net.ControlPoint.CpDevice _rendererDevice)
        {
            avTransport = new OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgAVTransport1(_rendererDevice);
                avTransport.SetPropertyInitialEvent(propertyChanged);
                avTransport.SetPropertyChanged(propertyChanged);
                avTransport.SetPropertyLastChangeChanged(propertyChanged);

                avTransport.Subscribe();
        }
Ejemplo n.º 10
0
        public CpAVRenderer_OhNet(OpenHome.Net.ControlPoint.CpDevice _rendererDevice)
        {
            XMLParser xmlParser = new XMLParser();

                renderingControl = new CpProxyUpnpOrgRenderingControl1(_rendererDevice);
                renderingControl.SetPropertyInitialEvent(propertyChanged);
                renderingControl.SetPropertyChanged(propertyChanged);
                renderingControl.SetPropertyLastChangeChanged(propertyChanged);
                renderingControl.Subscribe();

                avRendererDevice = _rendererDevice;
                avRendererDevice.GetAttribute("Upnp.DeviceXml", out DeviceXml);

                ModelDescription = xmlParser.getNodeValue(DeviceXml, "modelDescription");
                FriendlyName = xmlParser.getNodeValue(DeviceXml, "friendlyName");
                Manufacturer = xmlParser.getNodeValue(DeviceXml, "manufacturer");
                UniqueDeviceName = avRendererDevice.Udn();

                Connections = new List<CpAVConnection>();
                Connections.Add(new CpAVConnection_OhNet(avRendererDevice));
        }
Ejemplo n.º 11
0
 protected void RendererRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpAVRenderer avRenderer = new CpAVRenderer_OhNet(aDevice);
         this.RendererRemovedSink(avRenderer);
 }
Ejemplo n.º 12
0
 protected void MediaServerRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpMediaServer mediaServer = new CpMediaServer_OhNet(aDevice);
         this.MediaServerRemovedSink(mediaServer);
 }
Ejemplo n.º 13
0
 protected void ConfigServiceRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpConfigService configService = new CpConfigService_OhNet(aDevice);
         this.ConfigServiceRemovedSink(configService);
 }
Ejemplo n.º 14
0
 public unsafe ParameterRelated(String aName, OpenHome.Net.Core.Property aProperty)
 {
     IntPtr name = InteropUtils.StringToHGlobalUtf8(aName);
     iHandle = ServiceParameterCreateRelated(name, aProperty.Handle());
     Marshal.FreeHGlobal(name);
 }
Ejemplo n.º 15
0
 public CpContentDirectory_OhNet_Raumfeld(OpenHome.Net.ControlPoint.CpDevice _device)
 {
     device = _device;
         contentDirectory = new OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgContentDirectory1(_device);
         contentDirectory.SetPropertyContainerUpdateIDsChanged(ContainerUpdateIDsSink);
         contentDirectory.Subscribe();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Register an action as available.  The action will be published as part of the owning device's service xml
 /// </summary>
 /// <param name="aAction">Action being registered as availabke</param>
 /// <param name="aDelegate">Delegate to call when the action is invoked</param>
 /// <param name="aPtr">Data to pass to the delegate</param>
 protected void EnableAction(OpenHome.Net.Core.Action aAction, ActionDelegate aDelegate, IntPtr aPtr)
 {
     iActions.Add(aAction);
     DvProviderAddAction(iHandle, aAction.Handle(), aDelegate, aPtr);
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Handler for CpDeviceList if devices are found on the network.
        /// </summary>
        /// <param name="aList"></param>
        /// <param name="aDevice"></param>
        private void DeviceAdded(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
        {
            lock (deviceList)
            {
                PrintDeviceInfo("Found", aDevice);

                string deviceXml;
                aDevice.GetAttribute("Upnp.DeviceXml", out deviceXml);

                XmlDocument xmlDeviceDescription = new XmlDocument();
                xmlDeviceDescription.LoadXml(deviceXml);

                if (UPnPTools.isMediaRenderer(xmlDeviceDescription))
                {
                    deviceList.Add(aDevice.Udn(), new UPnPDevice(aDevice, xmlDeviceDescription));
                    Utils.Logger.Log(Utils.Logger.Level.Debug, "Found usefull MediaRenderer: " + deviceList [aDevice.Udn()].FriendlyName);
                    OnDeviceDiscovered(deviceList [aDevice.Udn()]);
                }
            }
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Create a new device factory. Requires a running device stack.
 /// </summary>
 public DvDeviceFactory(OpenHome.Net.Core.DeviceStack aDeviceStack)
 {
     iDeviceStack = aDeviceStack;
     if (iDeviceStack == null)
     {
         throw new ArgumentNullException("aDeviceStack");
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Handler for CpDeviceList if devices are removed from the network (they should 
 /// send a bye if they went offline, or announcement keep alive is over).
 /// </summary>
 /// <param name="aList"></param>
 /// <param name="aDevice"></param>
 private void DeviceRemoved(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     String udn = aDevice.Udn();
     try
     {
         UPnPDevice dev = deviceList [udn];
         lock (deviceList)
         {
             deviceList [udn].Free();
             deviceList.Remove(udn);
         }
         PrintDeviceInfo("Removed", aDevice);
         OnDeviceRemoved(dev);
     } catch (KeyNotFoundException)
     {
         Utils.Logger.Log(Utils.Logger.Level.Error, "Wanted to remove a UPnP-Device from my list but it's already gone!? :/");
     }
 }
Ejemplo n.º 20
0
 public OpenHome.Net.ControlPoint.CpDeviceList GetUpnpRootDeviceList(
     OpenHome.Net.ControlPoint.CpDeviceList.ChangeHandler aAdded,
     OpenHome.Net.ControlPoint.CpDeviceList.ChangeHandler aRemoved)
 {
     return new OpenHome.Net.ControlPoint.CpDeviceListUpnpRoot(aAdded, aRemoved);
 }
Ejemplo n.º 21
0
 public CpMediaServer_OhNet(OpenHome.Net.ControlPoint.CpDevice _device)
 {
     mediaServerDevice = _device;
         mediaServerDevice.GetAttribute("Upnp.FriendlyName", out ServerFriendlyName);
         mediaServerDevice.GetAttribute("Upnp.DeviceXml", out DeviceXml);
         mediaServerDevice.GetAttribute("Upnp.Location", out Location);
         contentDirectory = new CpContentDirectory_OhNet_Raumfeld(_device);
 }