33 lines
647 B
C#
33 lines
647 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace XmlParserByAttribute
|
|
{
|
|
[XmlRoot("cats")]
|
|
public class CatCollection
|
|
{
|
|
[XmlElement("cat")]
|
|
public List<Cat> Cats { get; set; } = new List<Cat>();
|
|
}
|
|
|
|
[XmlRoot("cat")]
|
|
public class Cat
|
|
{
|
|
[XmlAttribute("color")]
|
|
public string Color { get; set; }
|
|
|
|
[XmlElement("saying")]
|
|
public string Saying { get; set; }
|
|
|
|
[XmlAttribute("animType")]
|
|
public AnimationType animationType;
|
|
}
|
|
|
|
public enum AnimationType
|
|
{
|
|
Wrap,
|
|
Loop
|
|
}
|
|
} |