Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Xml;
- using System.Xml.Serialization;
- namespace S4TunnelServer.XML
- {
- [XmlType(AnonymousType = true)]
- [XmlRoot(Namespace = "", IsNullable = false, ElementName = "S4_Items")]
- public class S4Items
- {
- [XmlElement("Item")]
- public ItemDto[] items { get; set; }
- }
- [XmlType(AnonymousType = true)]
- public class ItemDto
- {
- [XmlAttribute("ID")]
- public uint ID { get; set; }
- [XmlAttribute("Color_Count")]
- public uint Colors { get; set; }
- [XmlAttribute("Name")]
- public string Name { get; set; }
- [XmlAttribute("Description")]
- public string Description { get; set; }
- }
- class Items
- {
- public static List<ItemDto> List = new List<ItemDto>();
- public static void LoadItems()
- {
- List = Reader.Deserialize<S4Items>("Items.xml").items.ToList();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement