InsertXmlConverter Method
Definition
- Namespace
- Cuemon.Extensions.Xml.Serialization.Converters
- Assemblies
- Cuemon.Extensions.Xml.dll
InsertXmlConverter<T>(IList<XmlConverter>, int, Action<XmlWriter, T, XmlQualifiedEntity>, Func<XmlReader, Type, T>, Func<Type, bool>, XmlQualifiedEntity)
Inserts an XML converter to the list at the specified index.
public static IList<XmlConverter> InsertXmlConverter<T>(this IList<XmlConverter> converters, int index, Action<XmlWriter, T, XmlQualifiedEntity> writer = null, Func<XmlReader, Type, T> reader = null, Func<Type, bool> canConvertPredicate = null, XmlQualifiedEntity qe = null)
Parameters
convertersIList<XmlConverter>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
- IList<XmlConverter>
A reference to
convertersafter the operation has completed.
Type Parameters
TThe type of the object to converts to and from XML.
Exceptions
- ArgumentNullException
converterscannot be null.