You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
836 B
34 lines
836 B
using System;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Threading.Tasks;
|
|
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)
|
|
{
|
|
var node = container.Descendants(name)
|
|
.FirstOrDefault();
|
|
|
|
return node == null ? null : node.Value;
|
|
}
|
|
}
|
|
}
|