我有以下xml:
<systemconfiguration>
<filelocations>
<datafile />
<samplefile />
</filelocations>
</systemconfiguration>
现在我有以下.cs用于此xml的序列化(反序列化):
[XmlType(TypeName = "systemconfiguration")]
public class SConfiguration : ISerializable
{
[XmlElement("filelocations")]
public FileLocations FilesL
{
get;
set;
}
}
[XmlType(TypeName = "filelocations")]
public class FileLocations: ISerializable
{
[XmlElement("datafile")]
public string DataFile
{
get;
set;
}
[XmlElement("samplefile")]
public string SampleFile
{
get;
set;
}
}
是否有更好的可能性而不是制作另一个只有少量字符串属性的“FileLocations”?