diff options
| author | crobibero <cody@robibe.ro> | 2020-09-01 18:24:42 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-01 18:24:42 -0600 |
| commit | f443c534bfac9feea4c92033e85a9aa5097ec4f5 (patch) | |
| tree | 6d0bcffc442c283f999232c54536c9d774a6f672 /Emby.Dlna/Ssdp/SsdpExtensions.cs | |
| parent | 852213d90cd6fe3c4e7b6922ca1f8162bc34c55e (diff) | |
| parent | 506fc7cbaeb8f82716f84b125ac598ff740bf552 (diff) | |
Merge remote-tracking branch 'upstream/master' into package-install-repo
Diffstat (limited to 'Emby.Dlna/Ssdp/SsdpExtensions.cs')
| -rw-r--r-- | Emby.Dlna/Ssdp/SsdpExtensions.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Emby.Dlna/Ssdp/SsdpExtensions.cs b/Emby.Dlna/Ssdp/SsdpExtensions.cs new file mode 100644 index 000000000..e7a52f168 --- /dev/null +++ b/Emby.Dlna/Ssdp/SsdpExtensions.cs @@ -0,0 +1,27 @@ +#pragma warning disable CS1591 + +using System.Linq; +using System.Xml.Linq; + +namespace Emby.Dlna.Ssdp +{ + public static class SsdpExtensions + { + public static string GetValue(this XElement container, XName name) + { + var node = container.Element(name); + + return node?.Value; + } + + public static string GetAttributeValue(this XElement container, XName name) + { + var node = container.Attribute(name); + + return node?.Value; + } + + public static string GetDescendantValue(this XElement container, XName name) + => container.Descendants(name).FirstOrDefault()?.Value; + } +} |
