Serializer inside Serializer Object C#
<p>I am not sure exactly what is the source of the error I am having so please request more detail if it will help. For some reason, when I try and deserialize my object not all the data is return(looking at the text file it all looks as if the data is there).</p>

<p>Here is the the things I think can id what the issue is(There is a lot of code on this project so a lot of things have been cut out to make it easier to read) :</p>

<pre><code>[Serializable]
public class Unit
{
    public List&lt;ModuleSlot&gt; slotsInFront { get; set; }

    //this would never be reached because the module slot has a customer xml serial object that prevents the normal xml reader from reaching this
    public string some_fake_text{get;set;}
 }

public class ModuleSlot
{
    [XmlIgnore()]
    public StreamShape moduleShape { get; set; }

    [XmlElement("moduleShape")]
    public ShapeSerializer xmlModuleShape
    {
        get
        {
            if (moduleShape == null)
                return null;
            else
            {
                return new ShapeSerializer(moduleShape);
            }
        }
        set
        {
            moduleShape = value.getFirstShape();
        }
    }

}
public class ShapeSerializer : IXmlSerializable
{

    public void ReadXml(System.Xml.XmlReader reader)
    {
        XmlReaderSettings settings = new XmlReaderSettings();
        settings.IgnoreWhitespace = true;
        System.Xml.XmlReader subReader = XmlReader.Create(reader.ReadSubtree(), settings);
        subReader.ReadStartElement();
        while (subReader.Depth &gt; 0)
        {
            xmlStreamShape newXmlShape = new xmlStreamShape();
            newXmlShape = (xmlStreamShape)new XmlSerializer(typeof(xmlStreamShape)).Deserialize(subReader);
            parameters.Add(newXmlShape.getShapeFromSaved());
            subReader.Read();
        }
    }

    public void WriteXml(System.Xml.XmlWriter writer)
    {
        XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
        ns.Add("", "");
        foreach (StreamShape item in parameters)
        {
            xmlStreamShape convertedShape = new xmlStreamShape(item);
            new XmlSerializer(typeof(xmlStreamShape)).Serialize(writer, convertedShape, ns);
        }
    }
}
</code></pre>

<p>...</p>
