コード例 #1
0
 /// <summary>Clone constructor. Generates a new <see cref="FhirXmlSerializationSettings"/> instance initialized from the state of the specified instance.</summary>
 /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
 public FhirXmlSerializationSettings(FhirXmlSerializationSettings other)
 {
     if (other == null)
     {
         throw Error.ArgumentNull(nameof(other));
     }
     other.CopyTo(this);
 }
コード例 #2
0
        /// <summary>Copy all configuration settings to another instance.</summary>
        /// <param name="other">Another <see cref="FhirXmlSerializationSettings"/> instance.</param>
        /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
        public void CopyTo(FhirXmlSerializationSettings other)
        {
            if (other == null)
            {
                throw Error.ArgumentNull(nameof(other));
            }

            other.SkipUnknownElements = SkipUnknownElements;
            other.Pretty = Pretty;
        }
コード例 #3
0
        /// <summary>Copy all configuration settings to another instance.</summary>
        /// <param name="other">Another <see cref="FhirXmlSerializationSettings"/> instance.</param>
        /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
        public void CopyTo(FhirXmlSerializationSettings other)
        {
            if (other == null)
            {
                throw Error.ArgumentNull(nameof(other));
            }

            other.IgnoreUnknownElements = IgnoreUnknownElements;
            other.Pretty        = Pretty;
            other.AppendNewLine = AppendNewLine;
        }
コード例 #4
0
 internal FhirXmlBuilder(FhirXmlSerializationSettings settings = null)
 {
     _settings = settings?.Clone() ?? new FhirXmlSerializationSettings();
 }
コード例 #5
0
 public static async Task <byte[]> ToXmlBytesAsync(this ITypedElement source, FhirXmlSerializationSettings settings = null)
 => await SerializationUtil.WriteXmlToBytesAsync(async writer => await source.WriteToAsync(writer, settings).ConfigureAwait(false)).ConfigureAwait(false);
コード例 #6
0
 /// <inheritdoc cref="ToXmlBytesAsync(ITypedElement, FhirXmlSerializationSettings)" />
 public static byte[] ToXmlBytes(this ITypedElement source, FhirXmlSerializationSettings settings = null)
 => SerializationUtil.WriteXmlToBytes(writer => source.WriteTo(writer, settings));
コード例 #7
0
 public static async Task <string> ToXmlAsync(this ITypedElement source, FhirXmlSerializationSettings settings = null)
 => await SerializationUtil.WriteXmlToStringAsync(async writer => await source.WriteToAsync(writer, settings).ConfigureAwait(false), settings?.Pretty ?? false, settings?.AppendNewLine ?? false).ConfigureAwait(false);
コード例 #8
0
 /// <inheritdoc cref="ToXmlAsync(ITypedElement, FhirXmlSerializationSettings)" />
 public static string ToXml(this ITypedElement source, FhirXmlSerializationSettings settings = null)
 => SerializationUtil.WriteXmlToString(writer => source.WriteTo(writer, settings), settings?.Pretty ?? false, settings?.AppendNewLine ?? false);
コード例 #9
0
 public static XDocument ToXDocument(this ITypedElement source, FhirXmlSerializationSettings settings = null) =>
 new FhirXmlBuilder(settings).Build(source);
コード例 #10
0
 public static async Task WriteToAsync(this ITypedElement source, XmlWriter destination, FhirXmlSerializationSettings settings = null) =>
 await new FhirXmlBuilder(settings).Build(source).writeToAsync(destination).ConfigureAwait(false);
コード例 #11
0
 /// <inheritdoc cref="WriteToAsync(ITypedElement, XmlWriter, FhirXmlSerializationSettings)" />
 public static void WriteTo(this ITypedElement source, XmlWriter destination, FhirXmlSerializationSettings settings = null) =>
 new FhirXmlBuilder(settings).Build(source).writeTo(destination);
コード例 #12
0
 public static XDocument ToXDocument(this Base source, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().ToXDocument(settings);
コード例 #13
0
 public static void WriteTo(this Base source, XmlWriter destination, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().WriteTo(destination, settings);
コード例 #14
0
 public static byte[] ToXmlBytes(this Base source, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().ToXmlBytes(settings);
コード例 #15
0
#pragma warning disable 612, 618
        public static string ToXml(this IElementNavigator source, FhirXmlSerializationSettings settings = null)
        => SerializationUtil.WriteXmlToString(writer => source.WriteTo(writer, settings), settings?.Pretty ?? false);