示例#1
0
        public virtual IComponent Clone(IPlatoHelper helper, string id = "", IComponent parent = null)
        {
            IComponent clone = New(helper);

            clone.Parent = parent ?? Parent;

            foreach (var parsed in Parsed.Where(p => p.Attribute.ToLower() != "id"))
            {
                clone.ParseAttribute(parsed.Attribute, parsed.Value);
            }

            clone.ParseAttribute("Id", id);

            foreach (var child in Children)
            {
                var cClone = child.Clone(helper, "", clone);
                clone.AddChild(cClone);
            }

            return(clone);
        }