Class HierarchyExtensions
- Namespace
- Cuemon.Extensions.Xml
- Assembly
- Cuemon.Extensions.Xml.dll
Extension methods for the IHierarchy<T> interface.
public static class HierarchyExtensions
- Inheritance
-
HierarchyExtensions
Methods
GetXmlQualifiedEntity(IHierarchy<Object>, XmlQualifiedEntity)
Resolves an XmlQualifiedEntity from either the specified qualifiedEntity
or from the IHierarchy{object}.
public static XmlQualifiedEntity GetXmlQualifiedEntity(this IHierarchy<object> hierarchy, XmlQualifiedEntity qualifiedEntity = null)
Parameters
hierarchy
IHierarchy<Object>The IHierarchy{object} to extend.
qualifiedEntity
XmlQualifiedEntityThe optional XmlQualifiedEntity that is part of the equation.
Returns
- XmlQualifiedEntity
An XmlQualifiedEntity that is either from
qualifiedEntity
, embedded withinhierarchy
, XmlRootAttribute, XmlElementAttribute, XmlAttributeAttribute or resolved from either member name or member type (in that order).
Exceptions
- ArgumentNullException
hierarchy
cannot be null.
HasXmlIgnoreAttribute(IHierarchy<Object>)
Determines whether the hierarchy
implements XmlIgnoreAttribute.
public static bool HasXmlIgnoreAttribute(this IHierarchy<object> hierarchy)
Parameters
hierarchy
IHierarchy<Object>The IHierarchy{object} to extend.
Returns
- Boolean
true
if the IHierarchy{object} implements XmlIgnoreAttribute; otherwise,false
.
Exceptions
- ArgumentNullException
hierarchy
cannot be null.
IsNodeEnumerable(IHierarchy<Object>)
Determines whether the hierarchy
implements either IEnumerable or IEnumerable<T> and is not a String.
public static bool IsNodeEnumerable(this IHierarchy<object> hierarchy)
Parameters
hierarchy
IHierarchy<Object>The IHierarchy{object} to extend.
Returns
- Boolean
true
if the IHierarchy{object} implements either IEnumerable or IEnumerable<T> and is not a String; otherwise,false
.
Exceptions
- ArgumentNullException
hierarchy
cannot be null.
OrderByXmlAttributes<T>(IEnumerable<IHierarchy<T>>)
Orders a sequence of IHierarchy<T> from hierarchies
by nodes having an XmlAttributeAttribute decoration.
public static IEnumerable<IHierarchy<T>> OrderByXmlAttributes<T>(this IEnumerable<IHierarchy<T>> hierarchies)
Parameters
hierarchies
IEnumerable<IHierarchy<T>>The IEnumerable{IHierarchy{object}} to extend.
Returns
- IEnumerable<IHierarchy<T>>
A sequence of IHierarchy<T> that is sorted by nodes having an XmlAttributeAttribute decoration first.
Type Parameters
T
The type of the node represented in the hierarchical structure.
Exceptions
- ArgumentNullException
hierarchies
cannot be null.