private bool matchMarkToXML(_Mark m, List <XmlNode> rows, ref Dictionary <_Mark, XmlNode> warning) { foreach (XmlNode row in rows) { XmlNode rebar = row["B2aBar"]; if (rebar == null) { return(false); } string type = XML_Handle.emptyNodehandle(rebar, "Type"); string pos_nr = XML_Handle.emptyNodehandle(rebar, "Litt"); string diam = XML_Handle.emptyNodehandle(rebar, "Dim"); if (m.Position_Shape == "A") { if (m.Position_Shape == type && m.Position_Nr.ToString() == pos_nr && m.Diameter.ToString() == diam) { write("Found in XML: " + m.ToString()); string rebarString = XML_Handle.getXMLRebarString(rebar); write(rebarString); write(""); return(true); } } else { if (m.Position_Nr.ToString() == pos_nr) { if (m.Position_Shape.ToString() != type) { warning[m] = rebar; } else if (m.Diameter.ToString() != diam) { warning[m] = rebar; } write("Found in XML: " + m.ToString()); string rebarString = XML_Handle.getXMLRebarString(rebar); write(rebarString); write(""); return(true); } } } return(false); }
private XmlNode matchMarkToXML(_Mark m, List <XmlNode> rows) { foreach (XmlNode row in rows) { XmlNode rebar = row["B2aBar"]; if (rebar == null) { return(null); } string type = XML_Handle.emptyNodehandle(rebar, "Type"); string pos_nr = XML_Handle.emptyNodehandle(rebar, "Litt"); string diam = XML_Handle.emptyNodehandle(rebar, "Dim"); if (m.Position_Shape == type && m.Position_Nr.ToString() == pos_nr && m.Diameter.ToString() == diam) { return(row); } } return(null); }
private double getRebarWeights(XmlNode row) { XmlNode rebar = row["B2aBar"]; if (rebar == null) { return(0); } string weightString = XML_Handle.emptyNodehandle(rebar, "Weight"); double weight = 0.0; try { weight = Double.Parse(weightString, System.Globalization.CultureInfo.InvariantCulture); } catch { } return(weight); }