Navigation :
Introduction
FAQ
Setup, deployment & projects
Getting started
Examples
Catel.Core
Catel.MVVM
Catel.Fody
Catel.ReSharper
Tips & tricks
API reference
-
Catel.Cores
--
Catel
---
Catel.Android
---
Catel.ApiCop
---
Catel.Caching
---
Catel.Collections
---
Catel.ComponentModel
---
Catel.Configuration
---
Catel.Core
---
Catel.Data
---
Catel.ExceptionHandling
---
Catel.IO
---
Catel.IoC
---
Catel.Linq
---
Catel.Logging
---
Catel.Messaging
---
Catel.Pooling
---
Catel.Reflection
---
Catel.Runtime
----
Catel.Runtime.Serialization
-----
Catel.Runtime.Serialization.Binary
-----
Catel.Runtime.Serialization.Xml
------ DataContractSerializerFactory
------ ICustomXmlSerializable
------ IDataContractSerializerFactory
------ IXmlNamespaceManager
------ IXmlSerializer
------ XmlHelper
------ XmlNamespace
------ XmlNamespaceManager
------ XmlSchemaHelper
------ XmlSchemaManager
------ XmlSerializationConfiguration
------ XmlSerializationContextInfo
------ XmlSerializationContextInfoFactory
------ XmlSerializer
------ XmlSerializerOptimalizationMode
----- CacheInvalidatedEventArgs
----- ExcludeFromSerializationAttribute
----- IFieldSerializable
----- IObjectAdapter
----- IPropertySerializable
----- ISerializable
----- ISerializationConfiguration
----- ISerializationContext
----- ISerializationContextExtensions
----- ISerializationContextInfo
----- ISerializationContextInfoFactory
----- ISerializationManager
----- ISerializationManagerExtensions
----- ISerializer
----- ISerializerExtensions
----- ISerializerModifier
----- IncludeInSerializationAttribute
----- KeyValuePairSerializerModifier
----- MemberMetadata
----- MemberSerializationEventArgs
----- MemberValue
----- ObjectAdapter
----- SerializableKeyValuePair
----- SerializationConfiguration
----- SerializationContext
----- SerializationContextHelper
----- SerializationContextMode
----- SerializationEventArgs
----- SerializationFactory
----- SerializationInfoSerializationContextInfo
----- SerializationManager
----- SerializationMemberGroup
----- SerializationModelInfo
----- SerializationObject
----- SerializationScope
----- SerializeAsCollectionAttribute
----- SerializeEnumAsStringAttribute
----- SerializeUsingParseAndToStringAttribute
----- SerializerBase
----- SerializerModifierAttribute
----- SerializerModifierBase
---- ReferenceEqualityComparer
---- ReferenceInfo
---- ReferenceManager
---- RuntimeBindingRedirect
---
Catel.Scoping
---
Catel.Services
---
Catel.Test
---
Catel.Text
---
Catel.Threading
--- Argument
--- AsyncEventHandler
--- AsyncEventHandlerExtensions
--- ByteArrayExtensions
--- CatelEnvironment
--- CompositeFilter
--- CompositePredicate
--- CoreModule
--- DesignTimeCodeAttribute
--- DesignTimeHelper
--- DesignTimeInitializer
--- Disposable
--- DisposableToken
--- Enum
--- EnvironmentHelper
--- EventHandlerExtensions
--- ExceptionExtensions
--- ExceptionFactory
--- ExpressionHelper
--- FastDateTime
--- HashHelper
--- IBindableEnum
--- ICommandManagerExtensions
--- ICompositeFilter
--- IDisposableToken
--- IExecute
--- IExecuteWithObject
--- IFluent
--- INotifyPropertyChangedExtensions
--- IUniqueIdentifyable
--- IWeakAction
--- IWeakEventListener
--- IWeakFunc
--- IWeakReference
--- JsonExtensions
--- KnownPlatforms
--- LanguageHelper
--- MVVMModule
--- MustBeImplementedException
--- NotSupportedInPlatformException
--- ObjectHelper
--- ObjectToStringHelper
--- OpenInstanceActionHandler
--- OpenInstanceEventHandler
--- ParallelHelper
--- Platforms
--- ProcessExtensions
--- ProgressContext
--- ResourceHelper
--- SerializationJsonModule
--- StringExtensions
--- StringToObjectHelper
--- SupportedPlatforms
--- TagHelper
--- ThemeHelper
--- ThreadHelper
--- UniqueIdentifierHelper
--- UriExtensions
--- WeakAction
--- WeakActionBase
--- WeakEventListener
--- WeakFunc
--
Systems
-
Catel.MVVMs
-
Catel.Serialization.Jsons
DataContractSerializerFactory
Name
Value
Assembly
Catel.Core
Namespace
Catel.Runtime.Serialization.Xml
Available on
.NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public class DataContractSerializerFactory : IDataContractSerializerFactory
Implements interfaces
IDataContractSerializerFactory
Default implementation of the IDataContractSerializerFactory interface.
Fields
Constructors
DataContractSerializerFactory()
Initializes a new instance of the DataContractSerializerFactory class.
Properties
DataContractResolver
Gets or sets the DataContractResolver passed in constructor to. The default value is.
DataContractSurrogate
Gets or sets the passed in constructor to. The default value is.
Methods
AddTypeToKnownTypesIfSerializable(Type typeToAdd, XmlSerializerTypeInfo serializerTypeInfo)
Adds the type to the known types if the type is serializable.
Parameters
Name
Description
typeToAdd
The type to add.
serializerTypeInfo
The serializer type info.
Returns
true
if the type is serializable; otherwisefalse
.
AllowNonPublicReflection(Type type)
Returns whether non-public reflection is allowed on the specified type.
Parameters
Name
Description
type
The type.
Returns
true
if non-public reflection is allowed,false
otherwise.
GetDataContractSerializer(Type serializingType, Type typeToSerialize, string xmlName, string rootNamespace, List<Type> additionalKnownTypes)
Gets the Data Contract serializer for a specific type. This method caches serializers so the performance can be improved when a serializer is used more than once.
Parameters
Name
Description
serializingType
The type that is currently (de)serializing.
typeToSerialize
The type to (de)serialize.
xmlName
Name of the property as known in XML.
rootNamespace
The root namespace.
additionalKnownTypes
A list of additional types to add to the known types.
Returns
for the given type.
Exceptions
Name
Description
ArgumentNullException
The serializingType isnull
.
ArgumentException
The xmlName isnull
or whitespace.
GetKnownTypes(Type type, XmlSerializerTypeInfo serializerTypeInfo, bool resolveAbstractClassesAndInterfaces)
Gets the known types inside the specific type.
Parameters
Name
Description
type
The type.
serializerTypeInfo
The serializer type info.
resolveAbstractClassesAndInterfaces
if set totrue
[resolve abstract classes and interfaces].
Returns
Array of that are found in the object type.
GetKnownTypesViaAttributes(Type type)
Gets the known types via attributes.
Parameters
Name
Description
type
The type.
Returns
The list of known types via the.
Exceptions
Name
Description
ArgumentNullException
The type isnull
.
IsTypeSerializable(Type type, XmlSerializerTypeInfo serializerTypeInfo)
Determines whether the specified type is serializable.
Parameters
Name
Description
type
The type.
serializerTypeInfo
The serializer type information.
Returns
true
if the specified type is serializable; otherwise,false
.
ShouldTypeBeIgnored(Type type, XmlSerializerTypeInfo serializerTypeInfo)
Determines whether the type should be handled.
Parameters
Name
Description
type
The type.
serializerTypeInfo
The serializer type info.
Returns
true
if the type should be handled; otherwise,false
.
Have a question about Catel? Use StackOverflow with the Catel tag!
Discussion
Please enable JavaScript to view the comments powered by Disqus.