-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move serialization docs #2780
move serialization docs #2780
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
title: "Attributes That Control XML Serialization" | ||
ms.custom: "" | ||
ms.date: "03/30/2017" | ||
ms.prod: ".net-framework" | ||
ms.prod: ".net" | ||
ms.reviewer: "" | ||
ms.suite: "" | ||
ms.tgt_pltfrm: "" | ||
|
@@ -26,9 +26,9 @@ ms.author: "erikre" | |
manager: "erikre" | ||
--- | ||
# Attributes That Control XML Serialization | ||
You can apply the attributes in the following table to classes and class members to control the way in which the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md). | ||
You can apply the attributes in the following table to classes and class members to control the way in which the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. convert to xref? |
||
|
||
These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/framework/serialization/xml-serialization-with-xml-web-services.md). | ||
These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/standard/serialization/xml-serialization-with-xml-web-services.md). | ||
|
||
For more information about attributes, see [Attributes](../../../docs/standard/attributes/index.md). | ||
|
||
|
@@ -50,12 +50,12 @@ You can apply the attributes in the following table to classes and class members | |
|
||
In addition to these attributes, which are all found in the <xref:System.Xml.Serialization> namespace, you can also apply the <xref:System.ComponentModel.DefaultValueAttribute> attribute to a field. The **DefaultValueAttribute** sets the value that will be automatically assigned to the member if no value is specified. | ||
|
||
To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/framework/serialization/attributes-that-control-encoded-soap-serialization.md). | ||
To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/standard/serialization/attributes-that-control-encoded-soap-serialization.md). | ||
|
||
## See Also | ||
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md) | ||
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md) | ||
[XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Convert to xref? |
||
[Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md) | ||
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/framework/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md) | ||
[How to: Serialize an Object](../../../docs/framework/serialization/how-to-serialize-an-object.md) | ||
[How to: Deserialize an Object](../../../docs/framework/serialization/how-to-deserialize-an-object.md) | ||
[Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md) | ||
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md) | ||
[How to: Serialize an Object](../../../docs/standard/serialization/how-to-serialize-an-object.md) | ||
[How to: Deserialize an Object](../../../docs/standard/serialization/how-to-deserialize-an-object.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
title: "Basic Serialization Technology Sample" | ||
ms.custom: "" | ||
ms.date: "03/30/2017" | ||
ms.prod: ".net-framework" | ||
ms.prod: ".net" | ||
ms.reviewer: "" | ||
ms.suite: "" | ||
ms.tgt_pltfrm: "" | ||
|
@@ -94,9 +94,9 @@ manager: "erikre" | |
<xref:System.Xml.Serialization> | ||
[Random class](https://msdn.microsoft.com/en-us/library/system.random.aspx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xref? |
||
[System.IO namespace](https://msdn.microsoft.com/en-us/library/system.io.aspx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xref? |
||
[Basic Serialization](../../../docs/framework/serialization/basic-serialization.md) | ||
[Binary Serialization](../../../docs/framework/serialization/binary-serialization.md) | ||
[Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md) | ||
[Introducing XML Serialization](../../../docs/framework/serialization/introducing-xml-serialization.md) | ||
[Serialization](../../../docs/framework/serialization/index.md) | ||
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md) | ||
[Basic Serialization](../../../docs/standard/serialization/basic-serialization.md) | ||
[Binary Serialization](../../../docs/standard/serialization/binary-serialization.md) | ||
[Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md) | ||
[Introducing XML Serialization](../../../docs/standard/serialization/introducing-xml-serialization.md) | ||
[Serialization](../../../docs/standard/serialization/index.md) | ||
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
title: "Basic Serialization" | ||
ms.custom: "" | ||
ms.date: "03/30/2017" | ||
ms.prod: ".net-framework" | ||
ms.prod: ".net" | ||
ms.reviewer: "" | ||
ms.suite: "" | ||
ms.tgt_pltfrm: "" | ||
|
@@ -46,7 +46,7 @@ formatter.Serialize(stream, obj); | |
stream.Close(); | ||
``` | ||
|
||
This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the [XMLSerializer Class](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx), which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/framework/serialization/selective-serialization.md). | ||
This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the [XMLSerializer Class](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx), which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/standard/serialization/selective-serialization.md). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xref for XMLSerializer? |
||
|
||
Restoring the object back to its former state is just as easy. First, create a stream for reading and a <xref:System.Runtime.Serialization.Formatter>, and then instruct the formatter to deserialize the object. The code example below shows how this is done. | ||
|
||
|
@@ -96,8 +96,8 @@ public class MyStuff : MyObject | |
} | ||
``` | ||
|
||
Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/framework/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled. | ||
Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/standard/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled. | ||
|
||
## See Also | ||
[Binary Serialization](../../../docs/framework/serialization/binary-serialization.md) | ||
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md) | ||
[Binary Serialization](../../../docs/standard/serialization/binary-serialization.md) | ||
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert to xref?