Table of Contents

Class HierarchyExtensions

Namespace
Cuemon.Extensions.Xml
Assembly
Cuemon.Extensions.Xml.dll

Extension methods for the IHierarchy<T> interface.

public static class HierarchyExtensions
Inheritance
Object
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 XmlQualifiedEntity

The optional XmlQualifiedEntity that is part of the equation.

Returns

XmlQualifiedEntity

An XmlQualifiedEntity that is either from qualifiedEntity, embedded within hierarchy, System.Xml.Serialization.XmlRootAttribute, System.Xml.Serialization.XmlElementAttribute, System.Xml.Serialization.XmlAttributeAttribute or resolved from either member name or member type (in that order).

Exceptions

System.ArgumentNullException

hierarchy cannot be null.

HasXmlIgnoreAttribute(IHierarchy<Object>)

Determines whether the hierarchy implements System.Xml.Serialization.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 System.Xml.Serialization.XmlIgnoreAttribute; otherwise, false.

Exceptions

System.ArgumentNullException

hierarchy cannot be null.

IsNodeEnumerable(IHierarchy<Object>)

Determines whether the hierarchy implements either System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> and is not a System.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 System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> and is not a System.String; otherwise, false.

Exceptions

System.ArgumentNullException

hierarchy cannot be null.

OrderByXmlAttributes<T>(IEnumerable<IHierarchy<T>>)

Orders a sequence of IHierarchy<T> from hierarchies by nodes having an System.Xml.Serialization.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 System.Xml.Serialization.XmlAttributeAttribute decoration first.

Type Parameters

T

The type of the node represented in the hierarchical structure.

Exceptions

System.ArgumentNullException

hierarchies cannot be null.