//nulindekseret liste public void DelData(int index) { if (index < 0) { System.Console.WriteLine("Wrong Index"); return; } int ElementCounter = 0; ListeElement Current = new ListeElement(); ListeElement Previous = new ListeElement(); Current = Head; Previous = Current; while (ElementCounter < index) { Previous = Current; Current = Current.Next; ElementCounter++; } Previous.Next = Current.Next; System.Console.WriteLine("Data deleted"); }
public void AddData(MinData NewData) { ListeElement ND = new ListeElement(); ListeElement Current = new ListeElement(); ND.data = NewData; if (Head.data == null) { Head = ND; } else { Current = Head; while (Current.Next != null) { Current = Current.Next; } Current.Next = ND; } System.Console.WriteLine("Data added"); }
public MiseEnBarre(Double lgBarreMax = -1) { if (lgBarreMax > 0) { LgBarre = lgBarreMax; } _listeElement = new ListeElement(LgBarre); }
public void PrintListe() { System.Console.WriteLine("Listen indeholder : "); ListeElement Current = new ListeElement(); Current = Head; while (Current != null) { System.Console.WriteLine($"{Current.data.Id} - {Current.data.Navn}"); Current = Current.Next; } }
private void ChargerCorps() { try { _listeElement = new ListeElement(LgBarre); foreach (var corps in ListeCorps.Values) { if (corps.Dvp) { _listeElement.AjouterElement(corps.Qte * Quantite, corps.RepereComplet, corps.Materiau, corps.Dimension, corps.Volume.eToDouble(), 90, 90); } } ExecuterEn(); _listeLgProfil = _listeElement.ListeLgProfil; } catch (Exception e) { this.LogErreur(new Object[] { e }); } }
public ListeLgProfil Analyser() { InitTime(); try { listeElement = new ListeElement(LgBarre); eTypeCorps Filtre = PrendreEnCompteTole ? eTypeCorps.Barre | eTypeCorps.Tole : eTypeCorps.Barre; HashSet <String> HashMateriaux = new HashSet <string>(ListeMateriaux); var dic = MdlBase.DenombrerDossiers(ComposantsExterne, fDossier => { BodyFolder swDossier = fDossier.GetSpecificFeature2(); if (Filtre.HasFlag(swDossier.eTypeDeDossier()) && HashMateriaux.Contains(swDossier.eGetMateriau())) { return(true); } return(false); } ); foreach (var mdl in dic.Keys) { mdl.eActiver(swRebuildOnActivation_e.swRebuildActiveDoc); foreach (var NomConfigPliee in dic[mdl].Keys) { mdl.ShowConfiguration2(NomConfigPliee); mdl.EditRebuild3(); PartDoc Piece = mdl.ePartDoc(); var ListeDossier = dic[mdl][NomConfigPliee]; foreach (var t in ListeDossier) { var IdDossier = t.Key; var QuantiteBarre = t.Value * Quantite; Feature fDossier = Piece.FeatureById(IdDossier); BodyFolder dossier = fDossier.GetSpecificFeature2(); var RefDossier = dossier.eProp(CONSTANTES.REF_DOSSIER); String Profil = dossier.eProp(CONSTANTES.PROFIL_NOM); Double Longueur = dossier.eProp(CONSTANTES.PROFIL_LONGUEUR).eToDouble(); Double A = dossier.eProp(CONSTANTES.PROFIL_ANGLE1).eToDouble(); Double B = dossier.eProp(CONSTANTES.PROFIL_ANGLE2).eToDouble(); if (String.IsNullOrWhiteSpace(Profil) || (Longueur == 0)) { continue; } if (String.IsNullOrWhiteSpace(RefDossier)) { WindowLog.EcrireF("{0}-{1}-{2} : Pas de reférence profil", mdl.eNomSansExt(), NomConfigPliee, fDossier.Name); continue; } var Materiau = dossier.ePremierCorps().eGetMateriauCorpsOuPiece(Piece, NomConfigPliee); if (!HashMateriaux.Contains(Materiau)) { continue; } Materiau = ForcerMateriau.IsRefAndNotEmpty(Materiau); listeElement.AjouterElement(QuantiteBarre, RefDossier, Materiau, Profil, Longueur, A, B); } } } ExecuterEn(); return(listeElement.ListeLgProfil); } catch (Exception e) { this.LogErreur(new Object[] { e }); } return(null); }
public MinListe() { Head = new ListeElement(); }