>   [System.Xml.Serialization.XmlTypeAttribute(
>     TypeName = "SensorID.Reader.Agile")]
>   public class AgileReaderSettings : IReaderSettings
>   {
>    private int  m_noAntennas;
>    private string m_ipAddress;
>    private int  m_port;
>    private int  m_autoIDTimeout;
>    private int  m_scanTimeout;
>    private ProtocolsList m_protocols;
>                 }
> The problem I am having is that I ccannot serialize the protocols list
> which is an array list of enumerated types. Everything else
> serializes with
> no problems. I am thinking the reason may be because it's a list of
> enumerated types.


I don't think the class you posted will serialize at all? Did you miss
some properties that are present in the original implementation?

What kind of List is the ProtocolsList? Is it derived from CollectionBase?

Enumerated types should not be a problem, but you need to attach
XmlArrayItem or XmlElement attributes to collections to specify the types
the XmlSerializer will encounter inside the collections, unless it's a
strongly typed collection. Your code with the attribute would look
something like:

[System.Xml.Serialization.XmlElement( typeof( ProtocolEnum )]
public ProtocolsList m_protocols;

HTH,
Christoph Schittko
Software Architect, .NET Mentor
MS MVP XML

Reply via email to