Exemple #1
0
        public static void Load(XmlNode section, MapinCheck check)
        {
            if (section == null)
            {
                return;
            }

            XmlNodeList list1 = section.SelectNodes(".//map");//获取所有的map节点

            foreach (XmlNode node in list1)
            {
                XmlAttribute temp = node.Attributes["split"];

                if (temp == null)
                {
                    Mapping.Add(node.Attributes["name"].Value,
                                node.Attributes["type"].Value, check);
                }
                else
                {
                    Mapping.Add(node.Attributes["name"].Value,
                                node.Attributes["type"].Value, temp.Value[0], check);
                }
            }
        }
Exemple #2
0
        public static void Load(string configSection, MapinCheck check)
        {
            XmlNode section = ConfigurationManager.GetSection(configSection) as XmlNode;

            //WinForm在设计时,会运行此段代码
            //
            if (section == null)
            {
                return;
            }
            //throw new WeedException("不存在[" + configSection + "]配置节");

            //------------------------------------------------------------
            Load(section, check);
        }
Exemple #3
0
        public static void Add(string name, string type, char split, MapinCheck check)
        {
            lock (Items)
            {
                foreach (Mapin map in Items)
                {
                    if (map.Name == name && map.Type == type)
                    {
                        return;
                    }
                }

                if (split > 0)
                {
                    split = '.';
                }

                Items.Add(new Mapin {
                    Name = name, Type = type, Split = split, Check = check
                });
            }
        }
Exemple #4
0
 public static void Add(string name, string type, MapinCheck check)
 {
     Add(name, type, '.', check);
 }