# FarPoint.Web.Spread.Model.Serializer.SerializeObject

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*">SerializeObject Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_String_System_Xml_XmlTextWriter_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.String,System.Xml.XmlTextWriter)">SerializeObject(object, string, XmlTextWriter)</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, string elementName, XmlTextWriter w)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, elementName As String, w As XmlTextWriter) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_String_System_Xml_XmlTextWriter_System_Reflection_Assembly_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.String,System.Xml.XmlTextWriter,System.Reflection.Assembly)">SerializeObject(object, string, XmlTextWriter, Assembly)</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, string elementName, XmlTextWriter w, Assembly callingAssembly)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, elementName As String, w As XmlTextWriter, callingAssembly As Assembly) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">callingAssembly</span></td>
      <td><p>Specifies the assembly that contains the implementation of the object</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_Type_System_String_System_Xml_XmlTextWriter_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.Type,System.String,System.Xml.XmlTextWriter)">SerializeObject(object, Type, string, XmlTextWriter)</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, Type saveInterface, string elementName, XmlTextWriter w)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, saveInterface As Type, elementName As String, w As XmlTextWriter) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></td>
      <td><span class="parametername">saveInterface</span></td>
      <td><p>Serialization interface to use</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_Type_System_String_System_Xml_XmlTextWriter_System_Reflection_Assembly_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.Type,System.String,System.Xml.XmlTextWriter,System.Reflection.Assembly)">SerializeObject(object, Type, string, XmlTextWriter, Assembly)</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, Type saveInterface, string elementName, XmlTextWriter w, Assembly callingAssembly)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, saveInterface As Type, elementName As String, w As XmlTextWriter, callingAssembly As Assembly) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></td>
      <td><span class="parametername">saveInterface</span></td>
      <td><p>Serialization interface to use</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">callingAssembly</span></td>
      <td><p>Specifies the assembly that contains the implementation of the object</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_Type_System_String_System_Xml_XmlTextWriter_System_Reflection_Assembly_System_Object___" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.Type,System.String,System.Xml.XmlTextWriter,System.Reflection.Assembly,System.Object[])">SerializeObject(object, Type, string, XmlTextWriter, Assembly, object[])</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, Type saveInterface, string elementName, XmlTextWriter w, Assembly callingAssembly, object[] args)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, saveInterface As Type, elementName As String, w As XmlTextWriter, callingAssembly As Assembly, args As Object()) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></td>
      <td><span class="parametername">saveInterface</span></td>
      <td><p>Serialization interface to use</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">callingAssembly</span></td>
      <td><p>Specifies the assembly that contains the implementation of the object</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>[]</td>
      <td><span class="parametername">args</span></td>
      <td><p>Arguments to pass to saveInterface.Serialize method (including w as first argument)</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SerializeObject_System_Object_System_Type_System_String_System_Xml_XmlTextWriter_System_Reflection_Assembly_System_Object___System_Boolean_" data-uid="FarPoint.Web.Spread.Model.Serializer.SerializeObject(System.Object,System.Type,System.String,System.Xml.XmlTextWriter,System.Reflection.Assembly,System.Object[],System.Boolean)">SerializeObject(object, Type, string, XmlTextWriter, Assembly, object[], bool)</h4>
<div class="markdown level1 summary"><p>Serializes an object to XML using the ISerializeSupport interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool SerializeObject(object o, Type saveInterface, string elementName, XmlTextWriter w, Assembly callingAssembly, object[] args, bool saveType)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(o As Object, saveInterface As Type, elementName As String, w As XmlTextWriter, callingAssembly As Assembly, args As Object(), saveType As Boolean) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">o</span></td>
      <td><p>Object to serialize</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></td>
      <td><span class="parametername">saveInterface</span></td>
      <td><p>Serialization interface to use</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">elementName</span></td>
      <td><p>Name of XML element</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlTextWriter</span></td>
      <td><span class="parametername">w</span></td>
      <td><p>XmlTextWriter object to which to save</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">callingAssembly</span></td>
      <td><p>Specifies the assembly that contains the implementation of the object</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>[]</td>
      <td><span class="parametername">args</span></td>
      <td><p>Arguments to pass to saveInterface.Serialize method (including w as first argument)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">saveType</span></td>
      <td><p>Whether to save</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>true if successful; otherwise, false</p>
</td>
    </tr>
  </tbody>
</table>
</div>
