Class ExtensionMethodsForSerialization
Extension methods for convenience that assist in simplifying the amount of code required for serializing instances and deserializing document sources.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class ExtensionMethodsForSerialization
Methods
Create<T>(T, Func<T, IConfigurationContainer>)
Declaration
[Obsolete("This is considered deprecated, unsupported functionality and will be removed in a future release.")]
public static IExtendedXmlSerializer Create<T>(this T this, Func<T, IConfigurationContainer> configure)
where T : IConfigurationContainer
Parameters
T
this
|
System.Func<T, IConfigurationContainer>
configure
|
Returns
IExtendedXmlSerializer
|
Type Parameters
T
|
Deserialize<T>(IExtendedXmlSerializer, Stream)
Deserialization convenience method to deserialize a document found within the provided System.IO.Stream into an instance of the requested instance type, using the default reader settings found at ReaderSettings.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, Stream stream)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.IO.Stream
stream
The stream containing the necessary data to deserialize the object of requested type. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Deserialize<T>(IExtendedXmlSerializer, TextReader)
Deserialization convenience method to deserialize a document found within the provided System.IO.TextReader into an instance of the requested instance type, using the default reader settings found at ReaderSettings.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, TextReader reader)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.IO.TextReader
reader
The reader containing the necessary data to deserialize the object of requested type. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Deserialize<T>(IExtendedXmlSerializer, String)
Deserialization convenience method to deserialize a document found within the provided string into an instance of the requested instance type, using reader settings that will close the stream once the process is complete.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, string data)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.String
data
A text representation of an Xml document. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Deserialize<T>(IExtendedXmlSerializer, XmlReaderSettings, Stream)
Deserialization convenience method to deserialize a document found within the provided System.IO.Stream into an instance of the requested instance type, using the provided System.Xml.XmlReaderSettings.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, XmlReaderSettings settings, Stream stream)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.Xml.XmlReaderSettings
settings
The reader settings for handling the xml reader used create the instance. |
System.IO.Stream
stream
The stream containing the necessary data to deserialize the object of requested type. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Deserialize<T>(IExtendedXmlSerializer, XmlReaderSettings, TextReader)
Deserialization convenience method to deserialize a document found within the provided System.IO.TextReader into an instance of the requested instance type, using the provided System.Xml.XmlReaderSettings.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, XmlReaderSettings settings, TextReader reader)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.Xml.XmlReaderSettings
settings
The reader settings for handling the xml reader used create the instance. |
System.IO.TextReader
reader
The reader containing the necessary data to deserialize the object of requested type. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Deserialize<T>(IExtendedXmlSerializer, XmlReaderSettings, String)
Deserialization convenience method to deserialize a document found within the provided string into an instance of the requested instance type, using the provided System.Xml.XmlReaderSettings.
Declaration
public static T Deserialize<T>(this IExtendedXmlSerializer this, XmlReaderSettings settings, string data)
Parameters
IExtendedXmlSerializer
this
The serializer to create the requested instance. |
System.Xml.XmlReaderSettings
settings
The reader settings for handling the xml reader used create the instance. |
System.String
data
A text representation of an Xml document. |
Returns
T
An instance of the requested type. |
Type Parameters
T
The requested instance type. |
Serialize(IExtendedXmlSerializer, Stream, Object)
Serialization convenience method to serialize the provided instance into a string along with the provided destination System.IO.Stream.
Declaration
public static string Serialize(this IExtendedXmlSerializer this, Stream stream, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.IO.Stream
stream
The destination stream. |
System.Object
instance
The instance to serialize. |
Returns
System.String
A string that represents the provided instance in Xml format. |
Serialize(IExtendedXmlSerializer, TextWriter, Object)
Serialization convenience method to serialize the provided instance into the provided destination System.IO.TextWriter.
Declaration
public static void Serialize(this IExtendedXmlSerializer this, TextWriter writer, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.IO.TextWriter
writer
The destination writer. |
System.Object
instance
The instance to serialize. |
Serialize(IExtendedXmlSerializer, Object)
Serialization convenience method to serialize the provided instance into a string.
Declaration
public static string Serialize(this IExtendedXmlSerializer this, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.Object
instance
The instance to serialize. |
Returns
System.String
A string that represents the provided instance in Xml format. |
Serialize(IExtendedXmlSerializer, XmlWriterSettings, Stream, Object)
Serialization convenience method to serialize the provided instance into a string along with the provided destination System.IO.Stream while using the settings configured in the provided System.Xml.XmlWriterSettings.
Declaration
public static string Serialize(this IExtendedXmlSerializer this, XmlWriterSettings settings, Stream stream, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.Xml.XmlWriterSettings
settings
The writer settings for handling the xml writer used create the resulting Xml. |
System.IO.Stream
stream
The destination stream. |
System.Object
instance
The instance to serialize. |
Returns
System.String
A string that represents the provided instance in Xml format. |
Serialize(IExtendedXmlSerializer, XmlWriterSettings, TextWriter, Object)
Serialization convenience method to serialize the provided instance into the provided destination System.IO.TextWriter while using the settings configured in the provided System.Xml.XmlWriterSettings.
Declaration
public static void Serialize(this IExtendedXmlSerializer this, XmlWriterSettings settings, TextWriter writer, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.Xml.XmlWriterSettings
settings
The writer settings for handling the xml writer used create the resulting Xml. |
System.IO.TextWriter
writer
The destination writer. |
System.Object
instance
The instance to serialize. |
Serialize(IExtendedXmlSerializer, XmlWriterSettings, Object)
Serialization convenience method to serialize the provided instance into a string with the provided System.Xml.XmlWriterSettings.
Declaration
public static string Serialize(this IExtendedXmlSerializer this, XmlWriterSettings settings, object instance)
Parameters
IExtendedXmlSerializer
this
The serializer to use for serialization. |
System.Xml.XmlWriterSettings
settings
The writer settings for handling the xml writer used create the resulting Xml. |
System.Object
instance
The instance to serialize. |
Returns
System.String
A string that represents the provided instance in Xml format. |