Пример #1
0
        public void AddChildren(IPAreaTableInfo info, string text)
        {
            if (_children == null)
            {
                _children = new List <IPAreaNode>();
            }
            IPAreaNode node = new IPAreaNode();

            node.text       = text;
            node.attributes = info;
            _children.Add(node);
        }
Пример #2
0
 private void LoadChildren(IPAreaNode parent, IPAreaTableInfo info)
 {
     if (!string.IsNullOrEmpty(info.Province))
     {
         IPAreaNode newnode = new IPAreaNode();
         newnode.text       = info.Province;
         newnode.AreaText   = string.Format("{0}/{1}", info.Country, info.Province);
         newnode.attributes = info;
         parent.AddChildren(newnode);
         if (!string.IsNullOrEmpty(info.City))
         {
             IPAreaNode citynode = new IPAreaNode();
             citynode.text       = info.City;
             citynode.AreaText   = string.Format("{0}/{1}/{2}", info.Country, info.Province, info.City);
             citynode.attributes = info;
             newnode.AddChildren(citynode);
         }
     }
 }
Пример #3
0
 private void LoadChildren(IPAreaNode parent,IPAreaTableInfo info)
 {
     if (!string.IsNullOrEmpty(info.Province))
     {
         IPAreaNode newnode = new IPAreaNode();
         newnode.text = info.Province;
         newnode.AreaText = string.Format("{0}/{1}", info.Country, info.Province);
         newnode.attributes = info;
         parent.AddChildren(newnode);
         if (!string.IsNullOrEmpty(info.City))
         {
             IPAreaNode citynode = new IPAreaNode();
             citynode.text = info.City;
             citynode.AreaText = string.Format("{0}/{1}/{2}", info.Country, info.Province, info.City);
             citynode.attributes = info;
             newnode.AddChildren(citynode);
         }
     }
 }
Пример #4
0
 static IPAreaCache()
 {
     _list.AddRange(IPAreaTableInfo.FindAll());
 }
Пример #5
0
 public void AddChildren(IPAreaTableInfo info, string text)
 {
     if (_children == null)
         _children = new List<IPAreaNode>();
     IPAreaNode node = new IPAreaNode();
     node.text = text;
     node.attributes = info;
     _children.Add(node);
 }