Ejemplo n.º 1
0
 private void listEnt_AfterLabelEdit(object sender, LabelEditEventArgs e)
 {
     if ((selected != null || selectedf != null) && isRename && e.Label != null)
     {
         if (listEnt.SelectedItems[0].ImageIndex == 0)
         {
             if (testForErrorDossier(e))
             {
                 selected.NomRep = e.Label;
                 selected.update();
                 fillTree();
             }
         }
         else
         {
             if (testForErrorFichier(e))
             {
                 selectedf.NomFic = e.Label;
                 //selectedf.Extension = e.Label.Split('.')[1];
                 selectedf.update();
                 fillList(listEnt);
             }
         }
     }
     else if (e.Label != null)
     {
         if (listEnt.SelectedItems[0].ImageIndex == 0)
         {
             if (testForErrorDossier(e))
             {
                 new Dossier(e.Label, currentDir.Id_d, DateTime.Now, true);
                 fillTree();
             }
         }
         else
         {
             if (testForErrorFichier(e))
             {
                 new Fichier(e.Label.Split('.')[0], e.Label.Split('.')[1], currentDir.Id_d, DateTime.Today, true);
                 fillList(listEnt);
             }
         }
     }
     else
     {
         e.CancelEdit = true;
         fillList(listEnt);
         fillTree();
     }
 }