Exemplo n.º 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);
 }
Exemplo n.º 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;
        }
        /// <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;
        }
Exemplo n.º 4
0
 internal FhirXmlBuilder(FhirXmlSerializationSettings settings = null)
 {
     _settings = settings?.Clone() ?? new FhirXmlSerializationSettings();
 }
Exemplo n.º 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);
Exemplo n.º 6
0
 /// <inheritdoc cref="ToXmlBytesAsync(ITypedElement, FhirXmlSerializationSettings)" />
 public static byte[] ToXmlBytes(this ITypedElement source, FhirXmlSerializationSettings settings = null)
 => SerializationUtil.WriteXmlToBytes(writer => source.WriteTo(writer, settings));
Exemplo n.º 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);
Exemplo n.º 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);
Exemplo n.º 9
0
 public static XDocument ToXDocument(this ITypedElement source, FhirXmlSerializationSettings settings = null) =>
 new FhirXmlBuilder(settings).Build(source);
Exemplo n.º 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);
Exemplo n.º 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);
Exemplo n.º 12
0
 public static XDocument ToXDocument(this Base source, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().ToXDocument(settings);
Exemplo n.º 13
0
 public static void WriteTo(this Base source, XmlWriter destination, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().WriteTo(destination, settings);
Exemplo n.º 14
0
 public static byte[] ToXmlBytes(this Base source, FhirXmlSerializationSettings settings = null) =>
 source.ToTypedElement().ToXmlBytes(settings);
#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);