Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
UPnPIcon.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5
7{
11 public class UPnPIcon
12 {
13 private readonly XmlElement xml;
14 private readonly Uri uri;
15 private readonly string mimetype;
16 private readonly string url;
17 private readonly int width;
18 private readonly int height;
19 private readonly int depth;
20
21 internal UPnPIcon(XmlElement Xml, Uri BaseUri)
22 {
23 this.xml = Xml;
24
25 foreach (XmlNode N in Xml.ChildNodes)
26 {
27 switch (N.LocalName)
28 {
29 case "mimetype":
30 this.mimetype = N.InnerText;
31 break;
32
33 case "width":
34 this.width = int.Parse(N.InnerText);
35 break;
36
37 case "height":
38 this.height = int.Parse(N.InnerText);
39 break;
40
41 case "depth":
42 this.depth = int.Parse(N.InnerText);
43 break;
44
45 case "url":
46 this.url = N.InnerText;
47 this.uri = new Uri(BaseUri, this.url);
48 break;
49 }
50 }
51 }
52
56 public XmlElement Xml => this.xml;
57
61 public Uri Uri => this.uri;
62
66 public string Mimetype => this.mimetype;
67
71 public string Url => this.url;
72
76 public int Width => this.width;
77
81 public int Height => this.height;
82
86 public int Depth => this.depth;
87
89 public override string ToString()
90 {
91 return this.url;
92 }
93 }
94}
Contains information about an icon.
Definition: UPnPIcon.cs:12
int Width
Width of icon
Definition: UPnPIcon.cs:76
string Mimetype
Internet Content Type
Definition: UPnPIcon.cs:66
int Height
Height of icon
Definition: UPnPIcon.cs:81
string Url
URL to image
Definition: UPnPIcon.cs:71
int Depth
Color depth of icon
Definition: UPnPIcon.cs:86
override string ToString()
Definition: UPnPIcon.cs:89
XmlElement Xml
Underlying XML definition.
Definition: UPnPIcon.cs:56