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
Object
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, 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

decorator cannot be null.

HasXmlIgnoreAttribute(IDecorator<IHierarchy<Object>>)

Determines whether the underlying IHierarchy{object} of the decorator implements System.Xml.Serialization.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 System.Xml.Serialization.XmlIgnoreAttribute; otherwise, false.

Exceptions

System.ArgumentNullException

decorator cannot be null.

IsNodeEnumerable(IDecorator<IHierarchy<Object>>)

Determines whether the underlying IHierarchy{object} of the decorator implements either System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> and is not a System.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 System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> and is not a System.String; otherwise, false.

Exceptions

System.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 System.Xml.Serialization.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 System.Xml.Serialization.XmlAttributeAttribute decoration first.

Type Parameters

T

The type of the node represented in the hierarchical structure.

Exceptions

System.ArgumentNullException

decorator cannot be null.

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

Attempts to get an System.Xml.Serialization.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 System.Xml.Serialization.XmlAttributeAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

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

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

Attempts to get an System.Xml.Serialization.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 System.Xml.Serialization.XmlElementAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

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

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

Attempts to get an System.Xml.Serialization.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 System.Xml.Serialization.XmlRootAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

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

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

Attempts to get an System.Xml.Serialization.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 System.Xml.Serialization.XmlTextAttribute associated with the underlying IHierarchy{object} of the decorator.

Returns

Boolean

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

See Also