Show / Hide Table of Contents

Class DataContractSerializer_CSHTML5Ver

Serializes and deserializes an instance of a type into an XML stream or document using a supplied data contract. This class cannot be inherited.

Inheritance
System.Object
DataContractSerializer_CSHTML5Ver
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Runtime.Serialization
Assembly: OpenSilver.dll
Syntax
public class DataContractSerializer_CSHTML5Ver

Constructors

| Improve this Doc View Source

DataContractSerializer_CSHTML5Ver(Type, Boolean)

Initializes a new instance of the System.Runtime.Serialization.DataContractSerializer class to serialize or deserialize an object of the specified type.

Declaration
public DataContractSerializer_CSHTML5Ver(Type type, bool useXmlSerializerFormat = false)
Parameters
Type Name Description
System.Type type

The type of the instances that are serialized or deserialized.

System.Boolean useXmlSerializerFormat
| Improve this Doc View Source

DataContractSerializer_CSHTML5Ver(Type, IEnumerable<Type>, Boolean)

Initializes a new instance of the System.Runtime.Serialization.DataContractSerializer class to serialize or deserialize an object of the specified type, and a collection of known types that may be present in the object graph.

Declaration
public DataContractSerializer_CSHTML5Ver(Type type, IEnumerable<Type> knownTypes, bool useXmlSerializerFormat = false)
Parameters
Type Name Description
System.Type type

The type of the instances that are serialized or deserialized.

System.Collections.Generic.IEnumerable<System.Type> knownTypes

An System.Collections.Generic.IEnumerable`1 of System.Type that contains the types that may be present in the object graph.

System.Boolean useXmlSerializerFormat

Properties

| Improve this Doc View Source

KnownTypes

Gets a collection of types that may be present in the object graph serialized using this instance of the System.Runtime.Serialization.DataContractSerializer.

Declaration
public IReadOnlyList<Type> KnownTypes { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyList<System.Type>

Methods

| Improve this Doc View Source

DeserializeFromString(String)

Declaration
public object DeserializeFromString(string xml)
Parameters
Type Name Description
System.String xml
Returns
Type Description
System.Object
| Improve this Doc View Source

DeserializeFromXElement(XElement)

Declaration
public object DeserializeFromXElement(XElement xElement)
Parameters
Type Name Description
System.Xml.Linq.XElement xElement
Returns
Type Description
System.Object
| Improve this Doc View Source

SerializeToString(Object, Boolean, Boolean)

Declaration
public string SerializeToString(object obj, bool indentXml = false, bool omitXmlDeclaration = false)
Parameters
Type Name Description
System.Object obj
System.Boolean indentXml
System.Boolean omitXmlDeclaration
Returns
Type Description
System.String
| Improve this Doc View Source

SerializeToXDocument(Object)

Declaration
public XDocument SerializeToXDocument(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Xml.Linq.XDocument
  • Improve this Doc
  • View Source