public void addMainPart(ElementData part) { mainParts.Add(part); }
public void buildData() { foreach (string rawPath in _rawPDF) { bool unique = uniquePath(rawPath, _pdfNotFound); if (unique) { _pdfNotFound.Add(rawPath); } } foreach (string rawPath in _rawDWG) { bool unique = uniquePath(rawPath, _dwgNotFound); if (unique) { _dwgNotFound.Add(rawPath); } } foreach (ArrayList element in _raw) { if ((bool)element[0] == true) { ElementData part = new ElementData((string)element[1], (string)element[2], (string)element[3]); this.allMainParts.Add(part); this.allParts.Add(part); } else { ElementData part; bool knownSpecialPart = false; foreach (ElementData spec in this.allSpecialParts) { if (spec.name == (string)element[1]) // dublicate special part { part = spec; part.addMainPart(this.allMainParts[this.allMainParts.Count - 1]); //add main part to special parts sublist this.allMainParts[this.allMainParts.Count - 1].addSpecialDetail(part); //add special part to main parts sublist knownSpecialPart = true; break; } } if (knownSpecialPart == false) // dublicate special part { part = new ElementData((string)element[1], (string)element[2], (string)element[3]); this.allSpecialParts.Add(part); //add new special part part.addMainPart(this.allMainParts[this.allMainParts.Count - 1]); //add main part to special parts sublist this.allMainParts[this.allMainParts.Count - 1].addSpecialDetail(part); //add special part to main parts sublist this.allParts.Add(part); // add special part to "all" list } } } foreach (ElementData main in allMainParts) { if (main.set == true) { foreach (ElementData special in main.specialDetails) { special.set = true; } } } }
public void addSpecialDetail(ElementData part) { specialDetails.Add(part); }