共用方式為


DataContractSerializerOperationBehavior.CreateSerializer 方法

定義

為序列化和還原序列化程序建立繼承自 XmlObjectSerializer 之類別的執行個體。

多載

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

為序列化和還原序列化程序建立繼承自 XmlObjectSerializer 之類別的執行個體。

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

使用包含命名空間的 XmlObjectSerializer,為序列化和還原序列化程序建立繼承自 XmlDictionaryString 之類別的執行個體。

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

為序列化和還原序列化程序建立繼承自 XmlObjectSerializer 之類別的執行個體。

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

參數

type
Type

要為其建立序列化程式的 Type

name
String

產生之類型的名稱。

ns
String

產生之型別的命名空間。

knownTypes
IList<Type>

包含已知型別之 IList<T>Type

傳回

XmlObjectSerializer

繼承自 XmlObjectSerializer 類別之類別的執行個體。

備註

NetDataContractSerializerDataContractSerializer 都是繼承自 XmlObjectSerializer 類別。

適用於

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

使用包含命名空間的 XmlObjectSerializer,為序列化和還原序列化程序建立繼承自 XmlDictionaryString 之類別的執行個體。

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

參數

type
Type

要序列化或還原序列化的類型。

name
XmlDictionaryString

已序列化之型別的名稱。

ns
XmlDictionaryString

XmlDictionaryString,其中包含已序列化之型別的命名空間。

knownTypes
IList<Type>

包含已知型別之 IList<T>Type

傳回

XmlObjectSerializer

繼承自 XmlObjectSerializer 類別之類別的執行個體。

備註

DataContractSerializerNetDataContractSerializer 都是繼承自 XmlObjectSerializer 類別。

適用於