DataContractSerializerOperationBehavior.CreateSerializer 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為序列化和還原序列化程序建立繼承自 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
參數
- name
- String
產生之類型的名稱。
- ns
- String
產生之型別的命名空間。
傳回
繼承自 XmlObjectSerializer 類別之類別的執行個體。
備註
NetDataContractSerializer 和 DataContractSerializer 都是繼承自 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
已序列化之型別的名稱。
XmlDictionaryString,其中包含已序列化之型別的命名空間。
傳回
繼承自 XmlObjectSerializer 類別之類別的執行個體。
備註
DataContractSerializer 和 NetDataContractSerializer 都是繼承自 XmlObjectSerializer 類別。