예제 #1
0
        public override IDocElementAMenuItems Clone()
        {
            DocMenu clone = new DocMenu(_id, _nom, _descrip, _position);

            foreach (DocMenuItem itm in Enfants)
            {
                clone._enfants.Add((DocMenuItem)itm.Clone());
            }

            return(clone);
        }
예제 #2
0
        public static void CreerArborescence(ref DocMenu mnupere, List <DocMenuItem> lstfils)
        {
            for (int i = lstfils.Count; i > 0; i--)
            {
                DocMenuItem itm = lstfils[i - 1];
                if (itm.ParentID == mnupere.ID)
                {
                    mnupere.Enfants.Add(itm);
                    CreerArborescence(ref itm, lstfils);
                }
            }

            mnupere.OrganiserFils();
        }
예제 #3
0
        private void ChargerMenus()
        {
            m_menus = new List <DocMenu>();
            List <DocMenuItem> lstmenusitems = new List <DocMenuItem>();

            foreach (CDocLigneAttribut li in m_lstAtts)
            {
                if (li.TypeAttribut == typeof(DocMenu))
                {
                    m_menus.Add((DocMenu)li.ObjetAttribut);
                }
                else if (li.TypeAttribut == typeof(DocMenuItem))
                {
                    lstmenusitems.Add((DocMenuItem)li.ObjetAttribut);
                }
            }

            for (int i = m_menus.Count; i > 0; i--)
            {
                DocMenu mnu = m_menus[i - 1];
                DocTools.CreerArborescence(ref mnu, lstmenusitems);
            }
        }