Example #1
0
 /// <summary>
 /// Copies the specified <paramref name="reader"/> using the specified delegate <paramref name="copier"/> and returns the result as an XML stream.
 /// </summary>
 /// <typeparam name="T">The type of the parameter of the delegate <paramref name="copier"/>.</typeparam>
 /// <param name="reader">The <see cref="XmlReader"/> object that contains the XML data.</param>
 /// <param name="copier">The delegate that will create an in-memory copy of <paramref name="reader"/> as a XML stream.</param>
 /// <param name="arg">The parameter of the delegate <paramref name="copier"/>.</param>
 /// <param name="setup">The <see cref="XmlCopyOptions"/> which need to be configured.</param>
 /// <returns>A <see cref="Stream"/> holding the XML copied by the delegate <paramref name="copier"/> from the source <paramref name="reader"/>.</returns>
 /// <exception cref="System.ArgumentNullException">
 /// <paramref name="reader"/> is null - or - <paramref name="copier"/> is null.
 /// </exception>
 public static Stream Copy <T>(this XmlReader reader, Action <XmlWriter, XmlReader, T> copier, T arg, Action <XmlCopyOptions> setup = null)
 {
     return(XmlWriterUtility.Copy(reader, copier, arg, setup));
 }
Example #2
0
 /// <summary>
 /// Copies the specified <paramref name="reader"/> using the specified delegate <paramref name="copier"/> and returns the result as an XML stream.
 /// </summary>
 /// <typeparam name="T1">The type of the first parameter of the delegate <paramref name="copier"/>.</typeparam>
 /// <typeparam name="T2">The type of the second parameter of the delegate <paramref name="copier"/>.</typeparam>
 /// <typeparam name="T3">The type of the third parameter of the delegate <paramref name="copier"/>.</typeparam>
 /// <param name="reader">The <see cref="XmlReader"/> object that contains the XML data.</param>
 /// <param name="copier">The delegate that will create an in-memory copy of <paramref name="reader"/> as a XML stream.</param>
 /// <param name="arg1">The first parameter of the delegate <paramref name="copier"/>.</param>
 /// <param name="arg2">The second parameter of the delegate <paramref name="copier"/>.</param>
 /// <param name="arg3">The third parameter of the delegate <paramref name="copier"/>.</param>
 /// <param name="setup">The <see cref="XmlCopyOptions"/> which need to be configured.</param>
 /// <returns>A <see cref="Stream"/> holding the XML copied by the delegate <paramref name="copier"/> from the source <paramref name="reader"/>.</returns>
 /// <exception cref="System.ArgumentNullException">
 /// <paramref name="reader"/> is null - or - <paramref name="copier"/> is null.
 /// </exception>
 public static Stream Copy <T1, T2, T3>(this XmlReader reader, Action <XmlWriter, XmlReader, T1, T2, T3> copier, T1 arg1, T2 arg2, T3 arg3, Action <XmlCopyOptions> setup = null)
 {
     return(XmlWriterUtility.Copy(reader, copier, arg1, arg2, arg3, setup));
 }
Example #3
0
 /// <summary>
 /// Copies everything from the specified <paramref name="reader"/> and returns the result as an XML stream.
 /// </summary>
 /// <param name="reader">The <see cref="XmlReader"/> object that contains the XML data.</param>
 /// <param name="setup">The <see cref="XmlCopyOptions"/> which need to be configured.</param>
 /// <returns>A <see cref="Stream"/> holding an exact copy of the source <paramref name="reader"/>.</returns>
 /// <exception cref="System.ArgumentNullException">
 /// <paramref name="reader"/> is null.
 /// </exception>
 public static Stream Copy(this XmlReader reader, Action <XmlCopyOptions> setup = null)
 {
     return(XmlWriterUtility.Copy(reader, setup));
 }