private void UpdateIntersectionElementInfo(int columnNumber, IntersectionElement clashElement) { for (int i = 0; i < propertyCount; i++) { dGrid[columnNumber, i].Value = IntersectionElementProperies[i].GetValue(clashElement); } }
public Intersection[] Extract() { HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument(); htmlDoc.Load(ReportPath, true); var clashes = htmlDoc.DocumentNode.SelectNodes("//div[@class='viewpoint']"); Intersection[] clearedClash = new Intersection[clashes.Count]; for (int i = 0; i < clashes.Count; i++) { var currentClash = clashes[i]; var currentIntersection = new Intersection(); var inModelElement = currentIntersection.InModelElement = new IntersectionElement(); var inLinkElement = currentIntersection.InLinkElement = new IntersectionElement(); IntersectionElement currentElement = null; bool notMeetIntersectionElement = true; foreach (var clild in currentClash.ChildNodes) { var currentChilds = clild.ChildNodes; if (currentChilds.Count == 2) { if (currentChilds[0].InnerText == "Имя") { currentIntersection.Name = currentChilds[1].InnerText; } ; if (currentChilds[0].InnerText == "Расположение сетки") { currentIntersection.GridLocation = currentChilds[1].InnerText; } ; if (currentChilds[0].InnerText == "Расположение сетки") { currentIntersection.GridLocation = currentChilds[1].InnerText; } ; if (currentChilds[0].InnerText == "Объект Id") { currentElement.ObjectId = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Элемент Файл источника") { currentElement.ModelName = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Элемент Тип") { currentElement.ElementType = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Имя системы") { currentElement.SystemName = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Категория") { currentElement.Category = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Семейство") { currentElement.Family = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Тип") { currentElement.ObjectType = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Имя") { currentElement.Name = currentChilds[1].InnerText; } if (currentChilds[0].InnerText == "Объект Рабочий набор") { currentElement.Workset = currentChilds[1].InnerText; } } else { if (clild.OuterHtml.Contains("href")) { continue; } if (notMeetIntersectionElement) { notMeetIntersectionElement = false; currentElement = currentIntersection.InModelElement; } else { currentElement = currentIntersection.InLinkElement; } } } clearedClash[i] = currentIntersection; } return(clearedClash); }