/// <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); }
/// <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; }
internal FhirXmlBuilder(FhirXmlSerializationSettings settings = null) { _settings = settings?.Clone() ?? new FhirXmlSerializationSettings(); }
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);
/// <inheritdoc cref="ToXmlBytesAsync(ITypedElement, FhirXmlSerializationSettings)" /> public static byte[] ToXmlBytes(this ITypedElement source, FhirXmlSerializationSettings settings = null) => SerializationUtil.WriteXmlToBytes(writer => source.WriteTo(writer, settings));
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);
/// <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);
public static XDocument ToXDocument(this ITypedElement source, FhirXmlSerializationSettings settings = null) => new FhirXmlBuilder(settings).Build(source);
public static async Task WriteToAsync(this ITypedElement source, XmlWriter destination, FhirXmlSerializationSettings settings = null) => await new FhirXmlBuilder(settings).Build(source).writeToAsync(destination).ConfigureAwait(false);
/// <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);
public static XDocument ToXDocument(this Base source, FhirXmlSerializationSettings settings = null) => source.ToTypedElement().ToXDocument(settings);
public static void WriteTo(this Base source, XmlWriter destination, FhirXmlSerializationSettings settings = null) => source.ToTypedElement().WriteTo(destination, settings);
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);