InsertXmlConverter Method
Definition
- Namespace
- Cuemon.Xml.Serialization.Converters
- Assemblies
- Cuemon.Xml.dll
InsertXmlConverter<T>(IDecorator<IList<XmlConverter>>, int, Action<XmlWriter, T, XmlQualifiedEntity>, Func<XmlReader, Type, T>, Func<Type, bool>, XmlQualifiedEntity)
Inserts an XML converter to the enclosed IList<T> of the specified decorator at the specified index.
public static IDecorator<IList<XmlConverter>> InsertXmlConverter<T>(this IDecorator<IList<XmlConverter>> decorator, int index, Action<XmlWriter, T, XmlQualifiedEntity> writer = null, Func<XmlReader, Type, T> reader = null, Func<Type, bool> canConvertPredicate = null, XmlQualifiedEntity qe = null)
Parameters
decoratorIDecorator<IList<XmlConverter>>The decorator that wraps the IList<T> to extend.
indexintThe zero-based index at which an XML converter should be inserted.
writerAction<XmlWriter, T, XmlQualifiedEntity>The delegate that converts
Tto its XML representation.readerFunc<XmlReader, Type, T>The delegate that generates
Tfrom its XML representation.canConvertPredicateFunc<Type, bool>The delegate that determines if an object can be converted.
qeXmlQualifiedEntityThe optional XmlQualifiedEntity that will provide the name of the root element.
Returns
- IDecorator<IList<XmlConverter>>
A reference to
decoratorafter the operation has completed.
Type Parameters
TThe type of the object to converts to and from XML.
Exceptions
- ArgumentNullException
decoratorcannot be null.