~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/Newtonsoft.Json/Doc/SerializationCallbacks.aml

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<topic id="SerializationCallbacks" revisionNumber="1">
 
3
  <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
 
4
    <!--
 
5
    <summary>
 
6
      <para>Optional summary abstract</para>
 
7
    </summary>
 
8
    -->
 
9
    <introduction>
 
10
      <!-- Uncomment this to generate an outline of the section and sub-section
 
11
           titles.  Specify a numeric value as the inner text to limit it to
 
12
           a specific number of sub-topics when creating the outline.  Specify
 
13
           zero (0) to limit it to top-level sections only.  -->
 
14
      <!-- <autoOutline /> -->
 
15
      <para>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.</para>
 
16
 
 
17
<list class="bullet">
 
18
  <listItem><para><legacyBold>OnSerializing</legacyBold></para></listItem>
 
19
  <listItem><para><legacyBold>OnSerialized</legacyBold></para></listItem>
 
20
  <listItem><para><legacyBold>OnDeserializing</legacyBold></para></listItem>
 
21
  <listItem><para><legacyBold>OnDeserialized</legacyBold></para></listItem>
 
22
</list>
 
23
<para>
 
24
To tell the serializer which methods should be called during the object's
 
25
serialization lifecycle, decorate a method with the appropraite attribute
 
26
(<codeEntityReference>T:System.Runtime.Serialization.OnSerializingAttribute</codeEntityReference>,
 
27
<codeEntityReference>T:System.Runtime.Serialization.OnSerializedAttribute</codeEntityReference>,
 
28
<codeEntityReference>T:System.Runtime.Serialization.OnDeserializingAttribute</codeEntityReference>,
 
29
<codeEntityReference>T:System.Runtime.Serialization.OnDeserializedAttribute</codeEntityReference>).
 
30
</para>
 
31
    </introduction>
 
32
    
 
33
    <!-- Add one or more top-level section elements.  These are collapsible.
 
34
         If using <autoOutline />, add an address attribute to identify it
 
35
         and specify a title so that it can be jumped to with a hyperlink. -->
 
36
    <section>
 
37
      <title>Example</title>
 
38
      <content>
 
39
        <!-- Uncomment this to create a sub-section outline
 
40
        <autoOutline /> -->
 
41
        <para>Example object with serialization callback methods:</para>
 
42
 
 
43
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializationCallbacksObject" title="Serialization Callback Attributes" />
 
44
 
 
45
        <para>The example object being serialized and deserialized by Json.NET:</para>
 
46
 
 
47
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializationCallbacksExample" title="Serialization Callback Example" />
 
48
 
 
49
      </content>
 
50
    </section>
 
51
    <relatedTopics>
 
52
      <codeEntityReference>T:System.Runtime.Serialization.OnSerializingAttribute</codeEntityReference>
 
53
      <codeEntityReference>T:System.Runtime.Serialization.OnSerializedAttribute</codeEntityReference>
 
54
      <codeEntityReference>T:System.Runtime.Serialization.OnDeserializingAttribute</codeEntityReference>
 
55
      <codeEntityReference>T:System.Runtime.Serialization.OnDeserializedAttribute</codeEntityReference>
 
56
    </relatedTopics>
 
57
  </developerConceptualDocument>
 
58
</topic>
 
 
b'\\ No newline at end of file'