aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SystemInfo/XMLConfig.cs
blob: a6113a0cb81853e1284b74416ce2f5f01e8f86cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Tango.SystemInfo
{
    class XMLConfig
    {
        private static List<string> propNames;

        public static List<string> GetSettings(string WMIClassName)
        {
            if (propNames == null)
            {
                propNames = new List<string>();
                System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
                xmldoc.Load(Tango.Core.Helpers.EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.SystemInfo.settings.xml"));
                System.Xml.XmlNode properties = xmldoc.SelectSingleNode("//" + WMIClassName);

                for (int i = 0; i < properties.ChildNodes.Count; i++)
                    propNames.Add(properties.ChildNodes[i].InnerText);

            }

            return propNames;
        }
    }
}