# C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder" data-uid="C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder" class="text-break">IMemberTypeEncoder Interface
</h1>
  <div class="markdown level0 summary"><p>This interface is used to allow objects and collection to serialize
types of their members in a custom way.
If a collection implements this interface, TypeToString is invoked during
serialization of collection items, and for all items for which it returns a
non-null string, that string is used as the element name of the item.
If a class implements this interface, AND a member of that class has
attribute TypeNameSerialization.Custom, AND does not have attribute
XmlAttribute (i.e. is serialized as an element), TypeToString is invoked
on the owner when that member is serialized, and if that returns a non-null
string, that string is used as the value of TypeName attribute.
When deserializing a collection which implements this interface,
StringToType is invoked for each new item in the collection, and if that
returns a non-null type, that type is used to create the item. Otherwise,
TypeNameSerialization attribute is used.
When deserializing a class which implements this interface, StringToType
is invoked on that class for members with TypeNameSerialization.Custom
attribute set.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.TrueDBGrid.Util.Xml.Serialization.html">C1.Win.TrueDBGrid.Util.Xml.Serialization</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.TrueDBGrid.10.dll</h6>
  <h5 id="C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public interface IMemberTypeEncoder</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Interface IMemberTypeEncoder</code></pre>
  </div>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder_StringToType_System_String_" data-uid="C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder.StringToType(System.String)">
          <a class="xref" href="C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder.StringToType.html#C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder_StringToType_System_String_">StringToType(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the type restored from the serialized string</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder_TypeToString_System_Object_" data-uid="C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder.TypeToString(System.Object)">
          <a class="xref" href="C1.Win.TrueDBGrid.Util.Xml.Serialization.IMemberTypeEncoder.TypeToString.html#C1_Win_TrueDBGrid_Util_Xml_Serialization_IMemberTypeEncoder_TypeToString_System_Object_">TypeToString(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a string representing the type of the object</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
