2using System.Collections.Generic;
13 private readonly XmlDocument xml;
15 private readonly
int majorVersion;
16 private readonly
int minorVersion;
17 private readonly
string baseUrl;
18 private readonly Uri baseUri;
24 if (!(
Xml.DocumentElement is
null) &&
Xml.DocumentElement.LocalName ==
"root" &&
25 Xml.DocumentElement.NamespaceURI ==
"urn:schemas-upnp-org:device-1-0")
27 if (!
string.IsNullOrEmpty(
BaseUrl))
30 this.baseUri =
new Uri(this.baseUrl);
33 foreach (XmlNode N
in Xml.DocumentElement.ChildNodes)
38 foreach (XmlNode N2
in N.ChildNodes)
43 this.majorVersion =
int.Parse(N2.InnerText);
47 this.minorVersion =
int.Parse(N2.InnerText);
54 this.baseUrl = N.InnerText;
55 this.baseUri =
new Uri(this.baseUrl);
59 this.device =
new UPnPDevice((XmlElement)N, this.baseUri, Client);
65 throw new Exception(
"Unrecognized file format.");
71 public XmlDocument
Xml => this.xml;
111 if (this.device is
null)
114 return this.device.
GetDevice(DeviceType);
124 if (this.device is
null)
148 return this.device.ServicesRecursive;
Contains the information provided in a Device Description Document, downloaded from a device in the n...
UPnPService GetService(string ServiceType)
Gets a service, given its service type.
UPnPDevice[] DevicesRecursive
Returns all devices, including the root device itself and its embedded devices, and their embedded de...
int MinorVersion
Minor version
UPnPDevice Device
Root device
override string ToString()
UPnPService[] ServicesRecursive
Returns all services, including the service of itself and services of its embedded devices,...
UPnPDevice GetDevice(string DeviceType)
Gets a device or embedded device, given its device type.
int MajorVersion
Major version
XmlDocument Xml
Underlying XML Document.
Implements support for the UPnP protocol, as described in: http://upnp.org/specs/arch/UPnP-arch-Devic...
Contains information about a device.
UPnPDevice GetDevice(string DeviceType)
Gets a device or embedded device, given its device type.
UPnPDevice[] DevicesRecursive
Returns all devices, including the device itself and its embedded devices, and their embedded devices...
Contains information about a service.
ServiceDescriptionDocument GetService()
Gets the service description document from a service in the network. This method is the synchronous v...