更新
This commit is contained in:
33
XmlParser/CatCollection.cs
Normal file
33
XmlParser/CatCollection.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user