Class HierarchyDecoratorExtensions
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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
qualifiedEntityXmlQualifiedEntityThe optional XmlQualifiedEntity that is part of the equation.
Returns
- XmlQualifiedEntity
An XmlQualifiedEntity that is either from
qualifiedEntity, embedded withindecorator, XmlRootAttribute, XmlElementAttribute, XmlAttributeAttribute or resolved from either member name or member type (in that order).
Exceptions
- ArgumentNullException
decoratorcannot 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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
Returns
- bool
trueif the underlying IHierarchy{object} of thedecoratorimplements XmlIgnoreAttribute; otherwise,false.
Exceptions
- ArgumentNullException
decoratorcannot 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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
Returns
- bool
trueif the underlying IHierarchy{object} of thedecoratorimplements either IEnumerable or IEnumerable<T> and is not a string; otherwise,false.
Exceptions
- ArgumentNullException
decoratorcannot 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
decoratorIDecorator<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
TThe type of the node represented in the hierarchical structure.
Exceptions
- ArgumentNullException
decoratorcannot 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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
xmlAttributeXmlAttributeAttributeWhen this method returns, contains the XmlAttributeAttribute associated with the underlying IHierarchy{object} of the
decorator.
Returns
- bool
trueif underlying IHierarchy{object} of thedecoratorcontains an XmlAttributeAttribute,falseotherwise.
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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
xmlAttributeXmlElementAttributeWhen this method returns, contains the XmlElementAttribute associated with the underlying IHierarchy{object} of the
decorator.
Returns
- bool
trueif underlying IHierarchy{object} of thedecoratorcontains an XmlElementAttribute,falseotherwise.
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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
xmlAttributeXmlRootAttributeWhen this method returns, contains the XmlRootAttribute associated with the underlying IHierarchy{object} of the
decorator.
Returns
- bool
trueif underlying IHierarchy{object} of thedecoratorcontains an XmlRootAttribute,falseotherwise.
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
decoratorIDecorator<IHierarchy<object>>The IDecorator{IHierarchy{object}} to extend.
xmlAttributeXmlTextAttributeWhen this method returns, contains the XmlTextAttribute associated with the underlying IHierarchy{object} of the
decorator.
Returns
- bool
trueif underlying IHierarchy{object} of thedecoratorcontains an XmlTextAttribute,falseotherwise.