private NodeGData recursiveCheckIfDataPresent(NodeGData ngdcn, NodeGData ngd) { if (ngdcn.DataType == scsm_MMS_TypeEnum.structure) { if (ngdcn.GetChildNodes().Length > 0) { foreach (NodeGData ngdcncn in ngdcn.GetChildNodes()) { NodeGData ret = recursiveCheckIfDataPresent(ngdcncn, ngd); if (ret != null) { return(ret); } } return(null); } else { return(null); } } else { if (ngd.Tag == ngdcn.Tag) { return(ngdcn); } else { return(null); } } }
private void recursiveReadGvl(NodeGData ngd, XElement el) { el.Add(new XElement("Data", new XAttribute("Type", ngd.DataType.ToString()), new XAttribute("Value", ngd.StringValue), (ngd.Tag is Data) ? (((ngd.Tag as Data).Description != null && (ngd.Tag as Data).Description != "") ? new XAttribute("Desc", (ngd.Tag as Data).Description) : null) : ((ngd.Description != null && ngd.Description != "") ? new XAttribute("Desc", ngd.Description) : null))); XElement eldn = el.Descendants().Last(); if (ngd.GetChildNodes().Length > 0) { foreach (NodeGData ngdcn in ngd.GetChildNodes()) { recursiveReadGvl(ngdcn, eldn); } } }
private NodeGData recursiveFindNodeGData(NodeGData ngd, string name) { if (name == ngd.CommAddress.Domain.ToString() + ((ngd.CommAddress.Variable.ToString() != "") ? ("/" + ngd.CommAddress.Variable.ToString().Replace("$", "/")) : "")) { return(ngd); } if (ngd.GetChildNodes().Length > 0) { foreach (NodeGData ngdcn in ngd.GetChildNodes()) { NodeGData ret = recursiveFindNodeGData(ngdcn, name); if (ret != null) { return(ret); } } } return(null); }