using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace Q694517
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
class DataItem
{
public string ShortName { get; set; }
public string Category { get; set; }
public string BaseTypeRef { get; set; }
public DataItem(string a, string b, string c)
{
ShortName = a;
Category = b;
BaseTypeRef = c;
}
}
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load("TunerServiceInterface.arxml");
var nodes = doc.GetElementsByTagName("IMPLEMENTATION-DATA-TYPE");
List<DataItem> data = new List<DataItem>();
foreach (XmlNode node in nodes)
{
try
{
var sn = node.ChildNodes.Cast<XmlNode>().FirstOrDefault(x => x.Name == "SHORT-NAME").InnerText;
var c = node.ChildNodes.Cast<XmlNode>().FirstOrDefault(x => x.Name == "CATEGORY").InnerText;
var btf = node.ChildNodes.Cast<XmlNode>().FirstOrDefault(x => x.Name == "SW-DATA-DEF-PROPS").InnerText;
data.Add(new DataItem(sn, c, btf));
}
catch { }
}
dataGridView1.DataSource = data;
}
}
}