Exemplo n.º 1
0
        internal override Component Clone(bool deep)
        {
            Section section = Ribbon.CreateSection("clonedSection-" + Ribbon.GetUniqueNumber(), Type, _alignment);

            if (!deep)
            {
                return(section);
            }

            int i = 0;

            foreach (Row row in Children)
            {
                foreach (object obj in row.Children)
                {
                    Component clonedComp = null;
                    if (obj is ControlComponent)
                    {
                        ControlComponent comp = (ControlComponent)obj;
                        clonedComp = comp.Clone(deep);
                    }
                    else if (obj is Strip)
                    {
                        clonedComp = ((Strip)obj).Clone(deep);
                    }
                    section.GetRow(i + 1).AddChild(clonedComp);
                }
                i++;
            }
            return(section);
        }