-Line endings
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Serialization Callbacks</title>
|
||||
<link href="styles.css" rel="stylesheet" type="text/css" />
|
||||
<link href="custom.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="control">
|
||||
<span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
|
||||
<span class="topicTitle">Serialization Callbacks</span></div>
|
||||
|
||||
<div id="content">
|
||||
<span style="color: DarkGray"> </span>
|
||||
|
||||
<p>Json.NET supports serialization callback methods. A callback can be used to
|
||||
manipulate an object before and after its serialization and deserialization by
|
||||
the JsonSerializer.</p>
|
||||
<ul>
|
||||
<li><b>OnSerializing</b></li>
|
||||
<li><b>OnSerialized</b></li>
|
||||
<li><b>OnDeserializing</b></li>
|
||||
<li><b>OnDeserialized</b></li>
|
||||
</ul>
|
||||
<p>To tell the serializer which methods should be called during the object's serialization
|
||||
lifecycle, decorate a method with the appropraite attribute (<a
|
||||
href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.onserializingattribute.aspx" target="_blank">OnSerializingAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.onserializedattribute.aspx" target="_blank">OnSerializedAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ondeserializingattribute.aspx" target="_blank">OnDeserializingAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ondeserializedattribute.aspx" target="_blank">OnDeserializedAttribute</a>).</p>
|
||||
<p>Example object with serialization callback methods:</p>
|
||||
|
||||
<div class="overflowpanel"> <div class="code">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Serialization Callbacks</title>
|
||||
<link href="styles.css" rel="stylesheet" type="text/css" />
|
||||
<link href="custom.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="control">
|
||||
<span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
|
||||
<span class="topicTitle">Serialization Callbacks</span></div>
|
||||
|
||||
<div id="content">
|
||||
<span style="color: DarkGray"> </span>
|
||||
|
||||
<p>Json.NET supports serialization callback methods. A callback can be used to
|
||||
manipulate an object before and after its serialization and deserialization by
|
||||
the JsonSerializer.</p>
|
||||
<ul>
|
||||
<li><b>OnSerializing</b></li>
|
||||
<li><b>OnSerialized</b></li>
|
||||
<li><b>OnDeserializing</b></li>
|
||||
<li><b>OnDeserialized</b></li>
|
||||
</ul>
|
||||
<p>To tell the serializer which methods should be called during the object's serialization
|
||||
lifecycle, decorate a method with the appropraite attribute (<a
|
||||
href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.onserializingattribute.aspx" target="_blank">OnSerializingAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.onserializedattribute.aspx" target="_blank">OnSerializedAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ondeserializingattribute.aspx" target="_blank">OnDeserializingAttribute</a>,
|
||||
<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ondeserializedattribute.aspx" target="_blank">OnDeserializedAttribute</a>).</p>
|
||||
<p>Example object with serialization callback methods:</p>
|
||||
|
||||
<div class="overflowpanel"> <div class="code">
|
||||
<div style="font-family: Courier New; font-size: 10pt; color: black;">
|
||||
<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">SerializationEventTestObject</span></pre>
|
||||
<pre style="margin: 0px;">{</pre>
|
||||
@@ -84,11 +84,11 @@
|
||||
<pre style="margin: 0px;"> }</pre>
|
||||
<pre style="margin: 0px;">}</pre>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<p>The example object being serialized and deserialized by Json.NET:</p>
|
||||
|
||||
<div class="overflowpanel"> <div class="code">
|
||||
</div></div>
|
||||
|
||||
<p>The example object being serialized and deserialized by Json.NET:</p>
|
||||
|
||||
<div class="overflowpanel"> <div class="code">
|
||||
<div style="font-family: Courier New; font-size: 10pt; color: black;">
|
||||
<pre style="margin: 0px;"><span style="color: #2b91af;">SerializationEventTestObject</span> obj = <span style="color: blue;">new</span> <span style="color: #2b91af;">SerializationEventTestObject</span>();</pre>
|
||||
<pre style="margin: 0px;"> </pre>
|
||||
@@ -129,15 +129,15 @@
|
||||
<pre style="margin: 0px;"><span style="color: green;">// This value was set after deserialization.</span></pre>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
<div id="footer">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user