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); }
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); } } }
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); } } }
static IPAreaCache() { _list.AddRange(IPAreaTableInfo.FindAll()); }
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); }