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); } } }
public static void OnDemandeAffichageRecherche(CNoeudCheminResultatRechercheObjetAvecParents noeud) { //Trouve l'objet donnée le plus bas dans les noeuds CNoeudCheminResultatRechercheObjetAvecParents noeudLePlusBas = noeud; while (noeudLePlusBas.NoeudFils != null) { noeudLePlusBas = noeudLePlusBas.NoeudFils; } CNoeudRechercheObjet_ObjetDonnee noeudObjet = noeudLePlusBas.Noeud as CNoeudRechercheObjet_ObjetDonnee; while (noeudLePlusBas != null) { CNoeudRechercheObjet_ObjetDonnee noeudTest = noeudLePlusBas.Noeud as CNoeudRechercheObjet_ObjetDonnee; if (noeudTest != null) { noeudObjet = noeudTest; } if (noeudObjet != null) { CObjetDonnee objet = noeudObjet.GetObjet(CSc2iWin32DataClient.ContexteCourant); if (objet != null) { CReferenceTypeForm refType = CFormFinder.GetRefFormToEdit(objet.GetType()); if (refType != null) { IFormNavigable form = refType.GetForm(objet as CObjetDonneeAIdNumeriqueAuto) as IFormNavigable; if (form != null) { CTimosApp.Navigateur.AffichePage(form); return; } } } } noeudLePlusBas = noeudLePlusBas.NoeudParent; } MessageBox.Show(I.T("Cannot display this element|20143")); }