Example #1
0
        private static void ParseEnumsSection(XmlReader rdr, ICollection <MavlinkEnumModel> protocolEnums)
        {
            var depth = rdr.Depth + 1;

            do
            {
                rdr.Read();
                if (rdr.Name == "enum")
                {
                    var enumItem = new MavlinkEnumModel
                    {
                        Name = rdr.GetAttribute("name")
                    };
                    protocolEnums.Add(enumItem);
                    ParseEnum(rdr, enumItem);
                }
            } while (rdr.Depth >= depth);
        }
Example #2
0
        private static void ParseEnum(XmlReader rdr, MavlinkEnumModel enumItem)
        {
            var depth = rdr.Depth + 1;

            do
            {
                rdr.Read();
                switch (rdr.Name)
                {
                case "description":
                    enumItem.Desc = ConvertDesc(rdr.ReadElementContentAsString());;
                    break;

                case "entry":
                    ParseEnumEntry(rdr, enumItem.Entries);
                    break;
                }
            } while (rdr.Depth >= depth);
        }