Exemplo n.º 1
0
 private void m_arbreResultat_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (OnDemandeAffichageNoeud != null && e.Node != null)
     {
         TreeNode node = e.Node;
         CNoeudCheminResultatRechercheObjetAvecParents noeudEnCours = null;
         while (node != null)
         {
             CArbreResultatRechercheObjet arbre = node.Tag as CArbreResultatRechercheObjet;
             if (arbre == null)//L'item n'est pas un arbre, stop la remontée
             {
                 break;
             }
             INoeudCheminResultatRechercheObjet noeud = null;
             if (arbre != null)
             {
                 noeud = arbre.Noeud;
             }
             if (noeud != null)
             {
                 noeudEnCours = new CNoeudCheminResultatRechercheObjetAvecParents(noeud, noeudEnCours);
             }
             node = node.Parent;
         }
         if (noeudEnCours != null)
         {
             OnDemandeAffichageNoeud(noeudEnCours);
         }
     }
 }
Exemplo n.º 2
0
 //-----------------------------------------------------------------------------
 private void FillNodes(TreeNodeCollection nodes, CArbreResultatRechercheObjet arbre)
 {
     //Ajoute les branches de l'arbre
     foreach (CArbreResultatRechercheObjet branche in arbre.Branches)
     {
         nodes.Add(CreateNodeBranche(branche));
     }
 }
Exemplo n.º 3
0
        private void CWndArbreResultatRequete_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            TreeNode node = e.Node;

            if (node.Nodes.Count == 1 && node.Nodes[0].Tag == null)
            {
                CArbreResultatRechercheObjet arbre = node.Tag as CArbreResultatRechercheObjet;
                node.Nodes.Clear();
                if (arbre != null)
                {
                    FillNodes(node.Nodes, arbre);
                }
            }
        }
Exemplo n.º 4
0
        //-----------------------------------------------------------------------------
        private TreeNode CreateNodeBranche(CArbreResultatRechercheObjet branche)
        {
            TreeNode node = new TreeNode(branche.Noeud.LibelleNoeudCheminResultatRechercheObjet);

            node.Tag = branche;
            if (branche.Branches.Length > 0)
            {
                node.Nodes.Add(new TreeNode(""));
            }
            int nIndex = 0;

            if (branche.Branches.Count() == 0)
            {
                nIndex = 1;
            }
            node.ImageIndex         = nIndex;
            node.SelectedImageIndex = nIndex;
            return(node);
        }