Table of Contents

Class HierarchyDecoratorExtensions

Namespace
Cuemon.Xml
Assembly
Cuemon.Xml.dll

Extension methods for the IHierarchy<T> interface hidden behind the IDecorator<T> interface.

public static class HierarchyDecoratorExtensions
Inheritance
HierarchyDecoratorExtensions

Methods

GetXmlQualifiedEntity(IDecorator<IHierarchy<Object>>, XmlQualifiedEntity)

Resolves an XmlQualifiedEntity from either the specified qualifiedEntity or from the underlying IHierarchy{object} of the decorator.

public static XmlQualifiedEntity GetXmlQualifiedEntity(this IDecorator<IHierarchy<object>> decorator, XmlQualifiedEntity qualifiedEntity = null)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{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 decorator, XmlRootAttribute, XmlElementAttribute, XmlAttributeAttribute or resolved from either member name or member type (in that order).

Exceptions

ArgumentNullException

decorator cannot be null.

HasXmlIgnoreAttribute(IDecorator<IHierarchy<Object>>)

Determines whether the underlying IHierarchy{object} of the decorator implements XmlIgnoreAttribute.

public static bool HasXmlIgnoreAttribute(this IDecorator<IHierarchy<object>> decorator)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

Returns

Boolean

true if the underlying IHierarchy{object} of the decorator implements XmlIgnoreAttribute; otherwise, false.

Exceptions

ArgumentNullException

decorator cannot be null.

IsNodeEnumerable(IDecorator<IHierarchy<Object>>)

Determines whether the underlying IHierarchy{object} of the decorator implements either IEnumerable or IEnumerable<T> and is not a String.

public static bool IsNodeEnumerable(this IDecorator<IHierarchy<object>> decorator)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

Returns

Boolean

true if the underlying IHierarchy{object} of the decorator implements either IEnumerable or IEnumerable<T> and is not a String; otherwise, false.

Exceptions

ArgumentNullException

decorator cannot be null.

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

Orders a sequence of IHierarchy<T> from the underlying IEnumerable{IHierarchy{object}} of the decorator by nodes having an XmlAttributeAttribute decoration.

public static IEnumerable<IHierarchy<T>> OrderByXmlAttributes<T>(this IDecorator<IEnumerable<IHierarchy<T>>> decorator)

Parameters

decorator IDecorator<IEnumerable<IHierarchy<T>>>

The IDecorator{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

decorator cannot be null.

TryGetXmlAttributeAttribute(IDecorator<IHierarchy<Object>>, out XmlAttributeAttribute)

Attempts to get an XmlAttributeAttribute from the underlying IHierarchy{object} of the decorator.

public static bool TryGetXmlAttributeAttribute(this IDecorator<IHierarchy<object>> decorator, out XmlAttributeAttribute xmlAttribute)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

xmlAttribute XmlAttributeAttribute

When this method returns, contains the XmlAttributeAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

true if underlying IHierarchy{object} of the decorator contains an XmlAttributeAttribute, false otherwise.

TryGetXmlElementAttribute(IDecorator<IHierarchy<Object>>, out XmlElementAttribute)

Attempts to get an XmlElementAttribute from the underlying IHierarchy{object} of the decorator.

public static bool TryGetXmlElementAttribute(this IDecorator<IHierarchy<object>> decorator, out XmlElementAttribute xmlAttribute)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

xmlAttribute XmlElementAttribute

When this method returns, contains the XmlElementAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

true if underlying IHierarchy{object} of the decorator contains an XmlElementAttribute, false otherwise.

TryGetXmlRootAttribute(IDecorator<IHierarchy<Object>>, out XmlRootAttribute)

Attempts to get an XmlRootAttribute from the underlying IHierarchy{object} of the decorator.

public static bool TryGetXmlRootAttribute(this IDecorator<IHierarchy<object>> decorator, out XmlRootAttribute xmlAttribute)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

xmlAttribute XmlRootAttribute

When this method returns, contains the XmlRootAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

true if underlying IHierarchy{object} of the decorator contains an XmlRootAttribute, false otherwise.

TryGetXmlTextAttribute(IDecorator<IHierarchy<Object>>, out XmlTextAttribute)

Attempts to get an XmlTextAttribute from the underlying IHierarchy{object} of the decorator.

public static bool TryGetXmlTextAttribute(this IDecorator<IHierarchy<object>> decorator, out XmlTextAttribute xmlAttribute)

Parameters

decorator IDecorator<IHierarchy<Object>>

The IDecorator{IHierarchy{object}} to extend.

xmlAttribute XmlTextAttribute

When this method returns, contains the XmlTextAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

true if underlying IHierarchy{object} of the decorator contains an XmlTextAttribute, false otherwise.

See Also