2020-01-22 20:00:07 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2020-05-25 21:52:51 +00:00
|
|
|
using System.Linq;
|
2019-01-13 19:54:44 +00:00
|
|
|
using System.Xml.Linq;
|
2016-10-29 22:22:20 +00:00
|
|
|
|
2016-10-29 22:34:54 +00:00
|
|
|
namespace Emby.Dlna.Ssdp
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-20 19:04:57 +00:00
|
|
|
public static class SsdpExtensions
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
public static string GetValue(this XElement container, XName name)
|
|
|
|
{
|
|
|
|
var node = container.Element(name);
|
|
|
|
|
2020-05-25 21:52:51 +00:00
|
|
|
return node?.Value;
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static string GetAttributeValue(this XElement container, XName name)
|
|
|
|
{
|
|
|
|
var node = container.Attribute(name);
|
|
|
|
|
2020-05-25 21:52:51 +00:00
|
|
|
return node?.Value;
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static string GetDescendantValue(this XElement container, XName name)
|
2020-05-25 21:52:51 +00:00
|
|
|
=> container.Descendants(name).FirstOrDefault()?.Value;
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
}
|