Files
06-Note/XmlParser/CatCollection.cs
sherlockforrest bf2ed2e31f 更新
2023-06-20 09:22:53 +08:00

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
}
}