示例#1
0
        public void Read(XmlReader reader, SpecRegistry model)
        {
            Value = SpecUtil.Parse(reader.GetAttribute("value"));
            Name  = reader.GetAttribute("name");
            Api   = reader.GetAttribute("api");
            var type = reader.GetAttribute("type");

            if (type != null && !Enum.TryParse(type, true, out Type))
            {
                throw new XmlException();
            }
            Alias = reader.GetAttribute("alias");
        }
示例#2
0
        public void Read(XmlReader reader, SpecRegistry model)
        {
            Namespace = reader.GetAttribute("namespace");
            Group     = reader.GetAttribute("group");
            Type      = reader.GetAttribute("type");
            Start     = SpecUtil.Parse(reader.GetAttribute("start"));
            End       = SpecUtil.Parse(reader.GetAttribute("end"));
            Ventor    = reader.GetAttribute("ventor");
            Comment   = reader.GetAttribute("comment");

            foreach (var child in reader.ReadElementTree())
            {
                if (child.Name == "enum")
                {
                    var value = new SpecEnum();
                    value.Read(child, model);
                    Enums.Add(value);
                }
            }
        }
示例#3
0
 public void Read(XmlReader reader, SpecRegistry model)
 {
     Type   = reader.GetAttribute("type");
     OpCode = (int)SpecUtil.Parse(reader.GetAttribute("opcode"));
 }