diff options
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; + } +} |
