private void Rechercher_Reperes() { Bdd = new BDD(); Predicate <Component2> Test = c => { if (c.ExcludeFromBOM) { return(false); } bool filtre = false; if (_CheckBox_ComposantsCache.IsChecked) { filtre = c.IsSuppressed(); } else { filtre = c.IsHidden(true); } if (!filtre && (c.TypeDoc() == eTypeDoc.Piece)) { ModelDoc2 mdl = c.eModelDoc2(); mdl.eActiver(swRebuildOnActivation_e.swRebuildActiveDoc); mdl.ShowConfiguration2(c.eNomConfiguration()); mdl.EditRebuild3(); PartDoc piece = mdl.ePartDoc(); foreach (var dossier in piece.eListeDesDossiersDePiecesSoudees(d => { return(!d.eEstExclu()); })) { Bdd.AjouterDossier(dossier, c); } } return(false); }; if (MdlBase.TypeDoc() == eTypeDoc.Piece) { Test(MdlBase.eComposantRacine()); } else { MdlBase.eRecParcourirComposants(Test, c => { if (c.ExcludeFromBOM) { return(false); } return(true); }); } MdlBase.eActiver(); }
private void Rechercher_Materiaux() { try { Bdd = new BDD(); bool Test(Component2 c) { if (c.TypeDoc() == eTypeDoc.Piece && (!c.IsSuppressed())) { bool filtre = true; if (!_CheckBox_ComposantsCache.IsChecked) { filtre = c.Visible == (int)swComponentVisibilityState_e.swComponentVisible; } if (filtre) { foreach (var dossier in c.eListeDesDossiersDePiecesSoudees()) { Bdd.AjouterDossier(dossier, c); } } } return(false); } bool Rec(Component2 c) { if (c.ExcludeFromBOM) { return(false); } return(true); } if (MdlBase.TypeDoc() == eTypeDoc.Piece) { Test(MdlBase.eComposantRacine()); } else { MdlBase.eRecParcourirComposants(Test, Rec); } } catch (Exception e) { this.LogMethode(new Object[] { e }); } }