07cc4be6a7
* 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
34 lines
795 B
C#
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;
|
|
}
|
|
}
|
|
}
|