コード例 #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();
        }
コード例 #2
0
ファイル: UPnP.cs プロジェクト: TilmannBach/cloudmusic2upnp
 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);
 }
コード例 #3
0
ファイル: UPnP.cs プロジェクト: TilmannBach/cloudmusic2upnp
 /// <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
     );
 }
コード例 #4
0
ファイル: UPnP.cs プロジェクト: TilmannBach/cloudmusic2upnp
        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();
        }
コード例 #5
0
ファイル: CpService.cs プロジェクト: broonie/ohNet
 /// <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;
 }
コード例 #6
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 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);
         }
 }
コード例 #7
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
        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();
        }
コード例 #8
0
ファイル: DvProvider.cs プロジェクト: nterry/ohNet
 /// <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());
 }
コード例 #9
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
        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();
        }
コード例 #10
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
        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));
        }
コード例 #11
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 protected void RendererRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpAVRenderer avRenderer = new CpAVRenderer_OhNet(aDevice);
         this.RendererRemovedSink(avRenderer);
 }
コード例 #12
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 protected void MediaServerRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpMediaServer mediaServer = new CpMediaServer_OhNet(aDevice);
         this.MediaServerRemovedSink(mediaServer);
 }
コード例 #13
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 protected void ConfigServiceRemovedSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     CpConfigService configService = new CpConfigService_OhNet(aDevice);
         this.ConfigServiceRemovedSink(configService);
 }
コード例 #14
0
ファイル: Service.cs プロジェクト: nterry/ohNet
 public unsafe ParameterRelated(String aName, OpenHome.Net.Core.Property aProperty)
 {
     IntPtr name = InteropUtils.StringToHGlobalUtf8(aName);
     iHandle = ServiceParameterCreateRelated(name, aProperty.Handle());
     Marshal.FreeHGlobal(name);
 }
コード例 #15
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 public CpContentDirectory_OhNet_Raumfeld(OpenHome.Net.ControlPoint.CpDevice _device)
 {
     device = _device;
         contentDirectory = new OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgContentDirectory1(_device);
         contentDirectory.SetPropertyContainerUpdateIDsChanged(ContainerUpdateIDsSink);
         contentDirectory.Subscribe();
 }
コード例 #16
0
ファイル: DvProvider.cs プロジェクト: nterry/ohNet
 /// <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);
 }
コード例 #17
0
ファイル: UPnP.cs プロジェクト: TilmannBach/cloudmusic2upnp
        /// <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()]);
                }
            }
        }
コード例 #18
0
ファイル: DvDevice.cs プロジェクト: Wodath/ohNet
 /// <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");
     }
 }
コード例 #19
0
ファイル: UPnP.cs プロジェクト: TilmannBach/cloudmusic2upnp
 /// <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!? :/");
     }
 }
コード例 #20
0
ファイル: ZappLibraryWrapper.cs プロジェクト: wifigeek/ohNet
 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);
 }
コード例 #21
0
ファイル: UPNPWrapper.cs プロジェクト: stoennies/raumwiese
 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);
 }