2using System.Collections.Generic;
13 private readonly XmlElement xml;
14 private readonly
string deviceType;
15 private readonly
string friendlyName;
16 private readonly
string manufacturer;
17 private readonly
string manufacturerURL;
18 private readonly
string modelDescription;
19 private readonly
string modelName;
20 private readonly
string modelNumber;
21 private readonly
string modelURL;
22 private readonly
string serialNumber;
23 private readonly
string udn;
24 private readonly
string upc;
28 private readonly
string presentationURL;
29 private readonly Uri manufacturerURI;
30 private readonly Uri modelURI;
31 private readonly Uri presentationURI;
35 List<UPnPIcon>
Icons =
new List<UPnPIcon>();
36 List<UPnPService>
Services =
new List<UPnPService>();
37 List<UPnPDevice>
Devices =
new List<UPnPDevice>();
41 foreach (XmlNode N
in Xml.ChildNodes)
46 this.deviceType = N.InnerText;
50 this.friendlyName = N.InnerText;
54 this.manufacturer = N.InnerText;
57 case "manufacturerURL":
58 this.manufacturerURL = N.InnerText;
59 this.manufacturerURI =
new Uri(BaseUri, this.manufacturerURL);
62 case "modelDescription":
63 this.modelDescription = N.InnerText;
67 this.modelName = N.InnerText;
71 this.modelNumber = N.InnerText;
75 this.modelURL = N.InnerText;
76 this.modelURI =
new Uri(BaseUri, this.modelURL);
80 this.serialNumber = N.InnerText;
84 this.udn = N.InnerText;
88 this.upc = N.InnerText;
92 foreach (XmlNode N2
in N.ChildNodes)
94 if (N2.LocalName ==
"icon")
100 foreach (XmlNode N2
in N.ChildNodes)
102 if (N2.LocalName ==
"service")
108 foreach (XmlNode N2
in N.ChildNodes)
110 if (N2.LocalName ==
"device")
115 case "presentationURL":
116 this.presentationURL = N.InnerText;
117 this.presentationURI =
new Uri(BaseUri, this.presentationURL);
122 this.icons =
Icons.ToArray();
124 this.devices =
Devices.ToArray();
130 public XmlElement
Xml => this.xml;
180 public string UDN => this.udn;
185 public string UPC => this.upc;
225 return this.friendlyName;
244 if (!(Result is
null))
270 if (!(Result is
null))
284 List<UPnPDevice> Result =
new List<UPnPDevice>()
292 return Result.ToArray();
303 List<UPnPService> Result =
new List<UPnPService>();
305 Result.AddRange(this.services);
309 return Result.ToArray();
Implements support for the UPnP protocol, as described in: http://upnp.org/specs/arch/UPnP-arch-Devic...
Contains information about a device.
string ModelDescription
Long user-friendly title
override string ToString()
UPnPService GetService(string ServiceType)
Gets a service, given its service type.
UPnPService[] Services
Services published by the 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...
string DeviceType
Device type
string UDN
Unique Device Name (uuid:UUID)
string FriendlyName
Short user-friendly title
Uri ManufacturerURI
URI to manufacturer site
string ManufacturerURL
URL to manufacturer site
string SerialNumber
Manufacturer's serial number
string PresentationURL
URL for presentation
UPnPIcon[] Icons
Icons for the device.
string ModelURL
URL to model site
Uri ModelURI
URI to model site
Uri PresentationURI
URI for presentation
string ModelName
Model name
UPnPDevice[] Devices
Embedded devices.
UPnPService[] ServicesRecursive
Returns all services, including the service of itself and services of its embedded devices,...
string ModelNumber
Model number
string UPC
Universal Product Code
string Manufacturer
Manufacturer name
XmlElement Xml
Underlying XML definition.
Contains information about an icon.
Contains information about a service.
string ServiceType
Service Type