예제 #1
0
        public List <DevKVItem> MapFunction(string sDevPlat, string sProcName)
        {
            List <DevKVItem> ls = new List <DevKVItem>();

            XmlNodeList nodes = m_Cfgdoc.SelectNodes("/Devolve/Process[@Name='" + sProcName + "']/Map/" + sDevPlat + "/Node");

            for (int i = 0; i < nodes.Count; i++)
            {
                try
                {
                    DevKVItem kvitem    = new DevKVItem();
                    string    sAttrName = nodes[i].Attributes[0].Value;
                    string    sType     = "";
                    if (nodes[i].Attributes.Count >= 2)
                    {
                        sType = nodes[i].Attributes[1].Value;
                    }
                    string sEnAttr = nodes[i].SelectSingleNode("/Devolve/Process[@Name='" + sProcName + "']/Map/" + sDevPlat + "/Node[@Name='" + sAttrName + "']").InnerText;
                    kvitem.sKey   = sAttrName;
                    kvitem.sValue = sEnAttr;
                    kvitem.sType  = sType;
                    ls.Add(kvitem);
                }
                catch
                {
                    continue;
                }
            }
            return(ls);
        }
        public List<DevKVItem> MapFunction(string sDevPlat, string sProcName)
        {
            List<DevKVItem> ls = new List<DevKVItem>();

            XmlNodeList nodes = m_Cfgdoc.SelectNodes("/Devolve/Process[@Name='" + sProcName + "']/Map/" + sDevPlat + "/Node");
            for (int i = 0; i < nodes.Count; i++)
            {
                try
                {
                    DevKVItem kvitem = new DevKVItem();
                    string sAttrName = nodes[i].Attributes[0].Value;
                    string sType = "";
                    if (nodes[i].Attributes.Count >= 2)
                    {
                        sType = nodes[i].Attributes[1].Value;
                    }
                    string sEnAttr = nodes[i].SelectSingleNode("/Devolve/Process[@Name='" + sProcName + "']/Map/" + sDevPlat + "/Node[@Name='" + sAttrName + "']").InnerText;
                    kvitem.sKey = sAttrName;
                    kvitem.sValue = sEnAttr;
                    kvitem.sType = sType;
                    ls.Add(kvitem);
                }
                catch
                {
                    continue;
                }
            }
            return ls;
        }