Table of Contents

Class XmlFormatterOptions

Namespace
Cuemon.Xml.Serialization.Formatters
Assembly
Cuemon.Xml.dll

Configuration options for XmlFormatter.

public class XmlFormatterOptions : IExceptionDescriptorOptions, IContentNegotiation, IValidatableParameterObject, IParameterObject
Inheritance
Object
XmlFormatterOptions
Implements

Constructors

XmlFormatterOptions()

Initializes a new instance of the XmlFormatterOptions class.

public XmlFormatterOptions()

Remarks

The following table shows the initial property values for an instance of XmlFormatterOptions.

PropertyInitial Value
SettingsXmlSerializerOptions
SynchronizeWithXmlConverttrue
SensitivityDetailsNone
SupportedMediaTypes
new List<MediaTypeHeaderValue>()
{
new("application/xml"),
new("text/xml")
};

Properties

DefaultConverters

Gets or sets a delegate that is invoked when XmlFormatterOptions is initialized and propagates registered XmlConverter implementations.

public static Action<IList<XmlConverter>> DefaultConverters { get; set; }

Property Value

Action<IList<XmlConverter>>

The delegate which propagates registered XmlConverter implementations when XmlFormatterOptions is initialized.

DefaultMediaType

Provides the default/fallback media type that the associated formatter should use when content negotiation either fails or is absent.

public static MediaTypeHeaderValue DefaultMediaType { get; }

Property Value

MediaTypeHeaderValue

The media type that the associated formatter should use when content negotiation either fails or is absent.

SensitivityDetails

Gets or sets a bitwise combination of the enumeration values that specify which sensitive details to include in the serialized result.

public FaultSensitivityDetails SensitivityDetails { get; set; }

Property Value

FaultSensitivityDetails

The enumeration values that specify which sensitive details to include in the serialized result.

Settings

Gets or sets the settings to support the XmlFormatter.

public XmlSerializerOptions Settings { get; set; }

Property Value

XmlSerializerOptions

A XmlSerializerOptions instance that specifies a set of features to support the XmlFormatter object.

SupportedMediaTypes

Gets or sets the collection of System.Net.Http.Headers.MediaTypeHeaderValue elements supported by the XmlFormatter.

public IReadOnlyCollection<MediaTypeHeaderValue> SupportedMediaTypes { get; set; }

Property Value

IReadOnlyCollection<MediaTypeHeaderValue>

A collection of System.Net.Http.Headers.MediaTypeHeaderValue elements supported by the XmlFormatter.

SynchronizeWithXmlConvert

Gets or sets a value indicating whether Settings should be synchronized on DefaultSettings.

public bool SynchronizeWithXmlConvert { get; set; }

Property Value

Boolean

true if Settings should be synchronized on DefaultSettings; otherwise, false.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

System.InvalidOperationException

Settings cannot be null.