Class ExtensionMethodsForExtensionModel
Extension methods that assist or enable functionality found within the extension model namespace ( ExtendedXmlSerializer.ExtensionModel).
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class ExtensionMethodsForExtensionModel
Methods
AllowExistingInstances(IConfigurationContainer)
Deprecated. Use AllowTargetInstances
instead.
Declaration
[Obsolete("Use AllowTargetInstances instead.")]
public static IConfigurationContainer AllowExistingInstances(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
|
Returns
IConfigurationContainer
|
See Also
AllowTargetInstances(IConfigurationContainer)
Enables the use of target instances to read values into when serialization occurs. Use this in conjunction with UsingTarget<T>(IExtendedXmlSerializer, T) to establish a target instance during deserialization. In this context, values read from the source document will be assigned to the provided existing target instance rather than the default behavior of creating a new instance altogether.
Declaration
public static IConfigurationContainer AllowTargetInstances(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Deserialize<T>(IExtendedXmlSerializer, T, Stream)
Use IExtendedXmlSerializer.UsingTarget.Deserialize
instead.
Declaration
[Obsolete("Use IExtendedXmlSerializer.UsingTarget.Deserialize instead.")]
public static T Deserialize<T>(this IExtendedXmlSerializer this, T existing, Stream stream)
where T : class
Parameters
IExtendedXmlSerializer
this
|
T
existing
|
System.IO.Stream
stream
|
Returns
T
|
Type Parameters
T
|
See Also
Deserialize<T>(IExtendedXmlSerializer, T, String)
Use IExtendedXmlSerializer.UsingTarget.Deserialize
instead.
Declaration
[Obsolete("Use IExtendedXmlSerializer.UsingTarget.Deserialize instead.")]
public static T Deserialize<T>(this IExtendedXmlSerializer this, T existing, string data)
where T : class
Parameters
IExtendedXmlSerializer
this
|
T
existing
|
System.String
data
|
Returns
T
|
Type Parameters
T
|
See Also
Deserialize<T>(IExtendedXmlSerializer, T, XmlReaderSettings, Stream)
Use IExtendedXmlSerializer.UsingTarget.Deserialize
instead.
Declaration
[Obsolete("Use IExtendedXmlSerializer.UsingTarget.Deserialize instead.")]
public static T Deserialize<T>(this IExtendedXmlSerializer this, T existing, XmlReaderSettings settings, Stream stream)
where T : class
Parameters
IExtendedXmlSerializer
this
|
T
existing
|
System.Xml.XmlReaderSettings
settings
|
System.IO.Stream
stream
|
Returns
T
|
Type Parameters
T
|
See Also
Deserialize<T>(IExtendedXmlSerializer, T, XmlReaderSettings, String)
Use IExtendedXmlSerializer.UsingTarget.Deserialize
instead.
Declaration
[Obsolete("Use IExtendedXmlSerializer.UsingTarget.Deserialize instead.")]
public static T Deserialize<T>(this IExtendedXmlSerializer this, T existing, XmlReaderSettings settings, string data)
where T : class
Parameters
IExtendedXmlSerializer
this
|
T
existing
|
System.Xml.XmlReaderSettings
settings
|
System.String
data
|
Returns
T
|
Type Parameters
T
|
See Also
EnableAllConstructors(IConfigurationContainer)
Enables all constructors -- in particular, private ones -- as candidates for selection when selecting a constructor to activate during deserialization. By default, only public constructors are considered. Calling this method configures the serializer so that all constructors -- private and otherwise -- are also considered.
Declaration
public static IConfigurationContainer EnableAllConstructors(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
EnableExpressions(IConfigurationContainer)
This is considered internal framework functionality and is not intended to be used from your code. However. 😁 This enables the use of expressions within deserialized properties (attached properties or markup extensions), so that they may be evaluated to a runtime value.
Declaration
public static IConfigurationContainer EnableExpressions(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
EnableImmutableTypes(IConfigurationContainer)
Enables the use of types found in the System.Collections.Immutable
namespace.
Declaration
public static IConfigurationContainer EnableImmutableTypes(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableMarkupExtensions(IConfigurationContainer)
Enables markup extensions support for the container. This allows you to create markup extensions and enable them within your XML, much like Xaml does for WPF.
Declaration
public static IConfigurationContainer EnableMarkupExtensions(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableMemberExceptionHandling(IConfigurationContainer)
Enables member exception handling during serialization and deserialization. By default when errors are encountered during these processes the exception is simply thrown without much context or detail. This is for performance considerations and to cut down on try/catches. Enabling this feature wraps serialization/deserialization in try-catches to provide more detail when exceptions occur.
Declaration
public static IConfigurationContainer EnableMemberExceptionHandling(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableRootInstances<T>(T)
This is considered internal framework functionality and is not intended to be used from your code. However. 😁
This enables root instances on a serializer. When used, components that use the IRootInstances
interface will have access to the root instance that was passed in for serialization, usually by using
IExtendedXmlSerializer's Serialize
method.
Declaration
public static T EnableRootInstances<T>(this T this)
where T : IRootContext
Parameters
T
this
The root context (usually an IConfigurationContainer) to configure. |
Returns
T
The configured root context (usually an IConfigurationContainer). |
Type Parameters
T
The root context type. |
EnableStaticReferenceChecking(IConfigurationContainer, Boolean)
Do not use this method unless you are familiar with its behavior. This removes static reference checking which speeds up performance but will lead to endless recursion if your graph indeed has a circular reference within it.
Note that this is very incompatible with EnableReferences. Please see provided GitHub link for more context and information.
Declaration
public static IConfigurationContainer EnableStaticReferenceChecking(this IConfigurationContainer this, bool enabled)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Boolean
enabled
Specifies if static-reference checking should be enabled. The default behavior is true. Specifying false will ignore static reference checking and improve performance for graphs that may have circular references (but shouldn't). |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableThreadAwareRecursionContent(IConfigurationContainer)
Enables thread protection during serializer initialization by locking the recursion-aware contents when serializer contents are established.
Declaration
public static IConfigurationContainer EnableThreadAwareRecursionContent(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableThreadProtection(IConfigurationContainer)
Enables thread protection and wraps a simple lock
around the reading and writing of the created serializer.
Declaration
public static IConfigurationContainer EnableThreadProtection(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
EnableUnknownContentHandling(IConfigurationContainer, Action<IFormatReader>)
This method is being deprecated. Please use ConfigurationContainer.WithUnknownContent.Call
instead.
Declaration
[Obsolete("This method is being deprecated. Please use ConfigurationContainer.WithUnknownContent.Call instead.")]
public static IConfigurationContainer EnableUnknownContentHandling(this IConfigurationContainer this, Action<IFormatReader> onMissing)
Parameters
IConfigurationContainer
this
|
System.Action<IFormatReader>
onMissing
|
Returns
IConfigurationContainer
|
See Also
UsingTarget<T>(IExtendedXmlSerializer, T)
Specifies an existing reference to use as target for deserialization of values. Read values during deserialization will be read and assigned into the provided target instance. NOTICE: Be sure to call AllowTargetInstances(IConfigurationContainer) when configuring the container before using this method.
Declaration
public static ReferencedDeserializationContext<T> UsingTarget<T>(this IExtendedXmlSerializer this, T instance)
where T : class
Parameters
IExtendedXmlSerializer
this
The serializer |
T
instance
The instance to deserialize |
Returns
ReferencedDeserializationContext<T>
A deserialization context that will assign values to the provided instance. |
Type Parameters
T
The instance type. |
See Also
WithArrayTypes(IEnumerable<Type>)
This is an unused method and will be removed in a future version.
Declaration
[Obsolete("This method is unused and will be removed in a future version.")]
public static IEnumerable<Type> WithArrayTypes(this IEnumerable<Type> this)
Parameters
System.Collections.Generic.IEnumerable<System.Type>
this
|
Returns
System.Collections.Generic.IEnumerable<System.Type>
|
WithUnknownContent(IConfigurationContainer)
Creates a new context for Unknown Content and allows the user to determine how the serializer behaves when it encounters unknown content during deserialization.
Declaration
public static UnknownContentContext WithUnknownContent(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
UnknownContentContext
The UnknownContentContext for further action and configuration. |