jellyfin/Emby.Dlna/Ssdp/Extensions.cs
Bond_009 07cc4be6a7 Fix some warnings
* Add analyzers to MediaBrowser.XbmcMetadata
* Enable TreatWarningsAsErrors for MediaBrowser.XbmcMetadata
* Add analyzers to MediaBrowser.WebDashboard
* Enable TreatWarningsAsErrors for MediaBrowser.WebDashboard
* Disable SA1600 in favor of CS1591
2020-02-23 12:11:43 +01:00

34 lines
795 B
C#

#pragma warning disable CS1591
using System.Xml.Linq;
namespace Emby.Dlna.Ssdp
{
public static class Extensions
{
public static string GetValue(this XElement container, XName name)
{
var node = container.Element(name);
return node == null ? null : node.Value;
}
public static string GetAttributeValue(this XElement container, XName name)
{
var node = container.Attribute(name);
return node == null ? null : node.Value;
}
public static string GetDescendantValue(this XElement container, XName name)
{
foreach (var node in container.Descendants(name))
{
return node.Value;
}
return null;
}
}
}