편집

다음을 통해 공유


DataContractSerializerOperationBehavior.CreateSerializer Method

Definition

Creates an instance of a class that inherits from XmlObjectSerializer for serialization and deserialization processes.

Overloads

CreateSerializer(Type, String, String, IList<Type>)

Creates an instance of a class that inherits from XmlObjectSerializer for serialization and deserialization processes.

CreateSerializer(Type, XmlDictionaryString, XmlDictionaryString, IList<Type>)

Creates an instance of a class that inherits from XmlObjectSerializer for serialization and deserialization processes with an XmlDictionaryString that contains the namespace.

CreateSerializer(Type, String, String, IList<Type>)

Source:
DataContractSerializerOperationBehavior.cs
Source:
DataContractSerializerOperationBehavior.cs

Creates an instance of a class that inherits from XmlObjectSerializer for serialization and deserialization processes.

public:
 virtual System::Runtime::Serialization::XmlObjectSerializer ^ CreateSerializer(Type ^ type, System::String ^ name, System::String ^ ns, System::Collections::Generic::IList<Type ^> ^ knownTypes);
public virtual System.Runtime.Serialization.XmlObjectSerializer CreateSerializer (Type type, string name, string ns, System.Collections.Generic.IList<Type> knownTypes);
abstract member CreateSerializer : Type * string * string * System.Collections.Generic.IList<Type> -> System.Runtime.Serialization.XmlObjectSerializer
override this.CreateSerializer : Type * string * string * System.Collections.Generic.IList<Type> -> System.Runtime.Serialization.XmlObjectSerializer
Public Overridable Function CreateSerializer (type As Type, name As String, ns As String, knownTypes As IList(Of Type)) As XmlObjectSerializer

Parameters

type
Type

The Type to create the serializer for.

name
String

The name of the generated type.

ns
String

The namespace of the generated type.

knownTypes
IList<Type>

An IList<T> of Type that contains known types.

Returns

An instance of a class that inherits from the XmlObjectSerializer class.

Remarks

Both the NetDataContractSerializer and the DataContractSerializer inherit from the XmlObjectSerializer class.

Applies to

CreateSerializer(Type, XmlDictionaryString, XmlDictionaryString, IList<Type>)

Source:
DataContractSerializerOperationBehavior.cs
Source:
DataContractSerializerOperationBehavior.cs

Creates an instance of a class that inherits from XmlObjectSerializer for serialization and deserialization processes with an XmlDictionaryString that contains the namespace.

public:
 virtual System::Runtime::Serialization::XmlObjectSerializer ^ CreateSerializer(Type ^ type, System::Xml::XmlDictionaryString ^ name, System::Xml::XmlDictionaryString ^ ns, System::Collections::Generic::IList<Type ^> ^ knownTypes);
public virtual System.Runtime.Serialization.XmlObjectSerializer CreateSerializer (Type type, System.Xml.XmlDictionaryString name, System.Xml.XmlDictionaryString ns, System.Collections.Generic.IList<Type> knownTypes);
abstract member CreateSerializer : Type * System.Xml.XmlDictionaryString * System.Xml.XmlDictionaryString * System.Collections.Generic.IList<Type> -> System.Runtime.Serialization.XmlObjectSerializer
override this.CreateSerializer : Type * System.Xml.XmlDictionaryString * System.Xml.XmlDictionaryString * System.Collections.Generic.IList<Type> -> System.Runtime.Serialization.XmlObjectSerializer
Public Overridable Function CreateSerializer (type As Type, name As XmlDictionaryString, ns As XmlDictionaryString, knownTypes As IList(Of Type)) As XmlObjectSerializer

Parameters

type
Type

The type to serialize or deserialize.

name
XmlDictionaryString

The name of the serialized type.

ns
XmlDictionaryString

An XmlDictionaryString that contains the namespace of the serialized type.

knownTypes
IList<Type>

An IList<T> of Type that contains known types.

Returns

An instance of a class that inherits from the XmlObjectSerializer class.

Remarks

Both the DataContractSerializer and the NetDataContractSerializer inherit from the XmlObjectSerializer class.

Applies to