mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-17 19:08:53 -07:00
28 lines
673 B
C#
28 lines
673 B
C#
#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;
|
|
}
|
|
}
|