private void Ajouter(String repere, BodyFolder dossier, Component2 cp) { List <Element> listElements = new List <Element>(); if (Dic.ContainsKey(repere)) { listElements = Dic[repere]; } else { Dic.Add(repere, listElements); } foreach (var corps in dossier.eListeDesCorps()) { listElements.Add(new Element(corps, cp)); } }
private void Ajouter(String baseMateriau, String materiau, String profil, BodyFolder dossier, Component2 cp) { SortedDictionary <String, SortedDictionary <String, List <Element> > > dicMat = new SortedDictionary <String, SortedDictionary <String, List <Element> > >(new WindowsStringComparer()); if (Dic.ContainsKey(baseMateriau)) { dicMat = Dic[baseMateriau]; } else { Dic.Add(baseMateriau, dicMat); } SortedDictionary <String, List <Element> > dicProfil = new SortedDictionary <String, List <Element> >(new WindowsStringComparer()); if (dicMat.ContainsKey(materiau)) { dicProfil = dicMat[materiau]; } else { dicMat.Add(materiau, dicProfil); } List <Element> listElements = new List <Element>(); if (dicProfil.ContainsKey(profil)) { listElements = dicProfil[profil]; } else { dicProfil.Add(profil, listElements); } foreach (var corps in dossier.eListeDesCorps()) { listElements.Add(new Element(corps, cp)); } }