GetDescendantElements() public method

Gets all of he descendant Element objects with a specific name
public GetDescendantElements ( string name ) : IList
name string
return IList
コード例 #1
0
        private string GetBreadcrumbWording(Element rootElement, Resource resource)
        {
            var title = rootElement.GetFirstDescendantNamed("title");

            if (title != null && !String.IsNullOrEmpty(title.Text))
            {
                return title.Text;
            }

            var headings = rootElement.GetDescendantElements("h1");
            foreach (var h1 in headings)
            {
                if (h1 != null && !String.IsNullOrEmpty(h1.Text))
                {
                    return h1.Text;
                }
            }

            if (resource != null)
            {
                var heading = resource.Name;
                if (!String.IsNullOrEmpty(heading))
                {
                    heading = this.StripExtension(heading);
                    heading = Capitalize(heading);
                    heading = DeCamelCase(heading);
                    return heading;
                }
            }

            return "(Up)";
        }