Table of Contents

Class ConfigurationsXmlSerializer<TConfiguration>

Namespace
Kentico.Forms.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll
public abstract class ConfigurationsXmlSerializer<TConfiguration>

Type Parameters

TConfiguration
Inheritance
object
ConfigurationsXmlSerializer<TConfiguration>
Derived
Extension Methods

Properties

ConfigurationElementName

Gets the name of the element containing the serialized TConfiguration.

protected abstract string ConfigurationElementName { get; }

Property Value

string

ConfiguredObjectElementName

Gets the name of the element containing the serialized configured object wrapped by TConfiguration.

protected abstract string ConfiguredObjectElementName { get; }

Property Value

string

ConfiguredObjectIdentifierElementName

Gets the name of the element containing type identifier of the serialized configured object wrapped by TConfiguration.

protected abstract string ConfiguredObjectIdentifierElementName { get; }

Property Value

string

Methods

CreateDeserializedConfiguration(string, object)

Creates a new TConfiguration based on deserialized typeIdentifier and configuredObject.

protected abstract TConfiguration CreateDeserializedConfiguration(string typeIdentifier, object configuredObject)

Parameters

typeIdentifier string

Type identifier of the configuredObject.

configuredObject object

Deserialized configured object.

Returns

TConfiguration

Returns deserialized configuration.

CreateXmlDeserializer(Type)

Creates an System.Xml.Serialization.XmlSerializer suitable for deserializing XML containing a configured object. Used to create a serializer for use in Deserialize(XmlElement) method.

protected virtual XmlSerializer CreateXmlDeserializer(Type configuredObjectType)

Parameters

configuredObjectType Type

Returns

XmlSerializer

CreateXmlSerializer(Type)

Creates an System.Xml.Serialization.XmlSerializer suitable for serializing an instance of TConfiguration encapsulating object of encapsulatedType. Used to create a serializer for use in Serialize(TConfiguration, Type, StringBuilder) method.

protected virtual XmlSerializer CreateXmlSerializer(Type encapsulatedType)

Parameters

encapsulatedType Type

Returns

XmlSerializer

Deserialize(XmlElement)

Deserializes a configuration from an XML element.

protected virtual TConfiguration Deserialize(XmlElement configurationXmlNode)

Parameters

configurationXmlNode XmlElement

XML representation of TConfiguration.

Returns

TConfiguration

Returns a TConfiguration configuration object.

Exceptions

InvalidOperationException

Thrown when deserialization of configurationXmlNode fails.

GetConfiguredObjectType(string)

Gets configured object type from a typeIdentifier.

protected abstract Type GetConfiguredObjectType(string typeIdentifier)

Parameters

typeIdentifier string

Returns

Type

Serialize(TConfiguration, Type, StringBuilder)

Serializes configuration and appends it to result.

protected virtual void Serialize(TConfiguration configuration, Type configuredType, StringBuilder result)

Parameters

configuration TConfiguration
configuredType Type
result StringBuilder

Exceptions

InvalidOperationException

Thrown when serialization of configuration fails.