Ejemplo n.º 1
0
            public void AppendChild(RuntimeAttribute ra)
            {
                var currentGroup    = groupChildren.Count > 0 ? groupChildren.Last.Value : null;
                var currentTemplate = groupChildren.Count > 0 ? groupChildren.Last.Value.Template : null;

                if (currentTemplate != ra.template)
                {
                    currentGroup = new TemplateChildGroup(ra.template);
                }

                currentGroup.Append(ra.node);

                ra.Parent = this;
                Children.Add(ra);
            }
Ejemplo n.º 2
0
            public void ResetChildren(Action <AppendChildMethod> builder)
            {
                TemplateNode       currentTemplate = null;
                TemplateChildGroup currentGroup    = null;

                builder((TemplateNode t, Node n) =>
                {
                    if (currentTemplate != t)
                    {
                        currentTemplate = t;
                        currentGroup    = new TemplateChildGroup(t);
                        groupChildren.AddLast(currentGroup);
                    }
                    currentGroup.Append(n);

                    var ra    = GetNodeRuntimeAttribute(n);
                    ra.Parent = this;
                    Children.Add(ra);
                });
            }