示例#1
0
 public void Write(RegionNode node, XmlWriter writer)
 {
     writer.WriteElement("region", delegate
     {
         writer.WriteAttribute("name", node.Name);
         var residents = node.GetResidents();
         foreach (var resident in residents)
         {
             this.WriteOnceResolved(resident, writer);
         }
     });
 }
示例#2
0
        public RegionNode Copy(RegionNode node)
        {
            var result    = new RegionNode(node.Name);
            var residents = node.GetResidents();

            foreach (var resident in residents)
            {
                var copied = this.CopyOnceResolved(resident);
                result.RegisterResident(resident);
            }
            return(result);
        }
        public IEnumerable <INode> TraverseRegion(RegionNode regionNode)
        {
            yield return(regionNode);

            var residents = regionNode.GetResidents();

            foreach (var resident in residents)
            {
                var nodes = this.TraverseOnceResolved(resident);
                foreach (var node in nodes)
                {
                    yield return(node);
                }
            }
        }