Struktura serializacji XML
Przepraszam, że nie potrafimy wyrazić tytułu bardziej konkretnie, ale mogę tylko wyjaśnić, podając przykład.
Usiłuję zbudować klasę, która serializuje do następującego XML
<Customize>
<Content></Content>
<Content></Content>
<!-- i.e. a list of Content -->
<Command></Command>
<Command></Command>
<Command></Command>
<!-- i.e. a list of Command -->
</Customize>
Mój C # to:
[XmlRoot]
public Customize Customize { get; set; }
i
public class Customize
{
public List<Content> Content { get; set; }
public List<Command> Command { get; set; }
}
Jednakże powoduje to (jak powinno) następujące:
<Customize>
<Content>
<Content></Content>
<Content></Content>
</Content>
<Command>
<Command></Command>
<Command></Command>
<Command></Command>
</Command>
</Customize>
Czy są jakieś atrybuty serializacji XML, które pomogłyby osiągnąć mój pożądany xml, czy muszę znaleźć inny sposób na napisanie klasy?