# FarPoint.Web.Spread.Model.Serializer.SaveObject

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*">SaveObject Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_String_System_String_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.String,System.String)">SaveObject(object, string, string)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a file.</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 SaveObject(object o, string fileName, string rootElement)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, fileName As String, rootElement As String) 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 save (must implement ISerializeSupport)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>File name to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_IO_Stream_System_String_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.IO.Stream,System.String)">SaveObject(object, Stream, string)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a stream.</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 SaveObject(object o, Stream stream, string rootElement)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, stream As Stream, rootElement As String) 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 save (must implement ISerializeSupport)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>Stream to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_Type_System_String_System_String_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.Type,System.String,System.String)">SaveObject(object, Type, string, string)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a file using the specified serialization 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 SaveObject(object o, Type saveInterface, string fileName, string rootElement)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, saveInterface As Type, fileName As String, rootElement As String) 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 save (must implement the specified serialization interface)</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 (must be ISerializeSupport, ISerializeSettings, ISerializeData, ISerializeStyles, ISerializeDrawing, or ISerializePresentation)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>File name to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_Type_System_String_System_String_System_Reflection_Assembly_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.Type,System.String,System.String,System.Reflection.Assembly)">SaveObject(object, Type, string, string, Assembly)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a file using the specified serialization 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 SaveObject(object o, Type saveInterface, string fileName, string rootElement, Assembly callingAssembly)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, saveInterface As Type, fileName As String, rootElement As String, 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 save (must implement the specified serialization interface)</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 (must be ISerializeSupport, ISerializeSettings, ISerializeData, ISerializeStyles, ISerializeDrawing, or ISerializePresentation)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>File name to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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>Calling assembly</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_Type_System_IO_Stream_System_String_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.Type,System.IO.Stream,System.String)">SaveObject(object, Type, Stream, string)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a stream using the specified serialization 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 SaveObject(object o, Type saveInterface, Stream stream, string rootElement)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, saveInterface As Type, stream As Stream, rootElement As String) 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 save (must implement the specified serialization interface)</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 (must be ISerializeSupport, ISerializeSettings, ISerializeData, ISerializeStyles, ISerializeDrawing, or ISerializePresentation)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>Stream to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_Model_Serializer_SaveObject_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject*"></a>
<h4 id="FarPoint_Web_Spread_Model_Serializer_SaveObject_System_Object_System_Type_System_IO_Stream_System_String_System_Reflection_Assembly_" data-uid="FarPoint.Web.Spread.Model.Serializer.SaveObject(System.Object,System.Type,System.IO.Stream,System.String,System.Reflection.Assembly)">SaveObject(object, Type, Stream, string, Assembly)</h4>
<div class="markdown level1 summary"><p>Saves an object as XML to a stream using the specified serialization 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 SaveObject(object o, Type saveInterface, Stream stream, string rootElement, Assembly callingAssembly)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveObject(o As Object, saveInterface As Type, stream As Stream, rootElement As String, 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 save (must implement the specified serialization interface)</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 (must be ISerializeSupport, ISerializeSettings, ISerializeData, ISerializeStyles, ISerializeDrawing, or ISerializePresentation)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>Stream to save object to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>Name of root XML element</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>Calling assembly</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></td>
    </tr>
  </tbody>
</table>
</div>
