Esempio 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);
        }
Esempio n. 2
0
        internal override Component Clone(bool deep)
        {
            Strip strip = Ribbon.CreateStrip("clonedStrip-" + Ribbon.GetUniqueNumber());

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

            foreach (ControlComponent comp in Children)
            {
                strip.AddChild(comp.Clone(deep));
            }
            return(strip);
        }
Esempio n. 3
0
        internal override Component Clone(bool deep)
        {
            if (NeedsDelayIniting)
            {
                DoDelayedInit();
            }

            Layout layout = Ribbon.CreateLayout("clonedLayout-" + Ribbon.GetUniqueNumber(), this.Title);

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

            foreach (Section section in Children)
            {
                Section clonedSection = (Section)section.Clone(deep);
                layout.AddChild(clonedSection);
            }
            return(layout);
        }