Files
06-Note/XmlParser/CatCollection.cs

33 lines
647 B
C#
Raw Permalink Normal View History

2023-06-20 09:22:53 +08:00
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
}
}