XElement_Extension.cs
    
    
    
    
    
        Home
            /
YED                    /
yEd.XGML                    /
IO                    /
Read                    /
                    XElement_Extension.cs
    
    
            
            using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace yEd.XGML.IO.Read
{
    internal static class XElement_Extension
    {
        public static XElement GetChild_Section(this XElement element, string name) =>
               element.Elements("section")
                   .FirstOrDefault(e => e.Attribute("name")
                       .Value == name);
        public static XElement GetChild_Attribute(this XElement element, string key) =>
            element.Elements("attribute")
                .FirstOrDefault(e => e.Attribute("key")
                    .Value == key);
    }
}