private void appendProcedureRelations(Dlineage dlineage, Element dlineageRelation) { targetProcedure[] targetProcedures = dlineage.Procedures.Item1.targetProcedures; if (targetProcedures != null && targetProcedures.Length > 0) { for (int z = 0; z < targetProcedures.Length; z++) { targetProcedure target = targetProcedures[z]; if (target.sourceProcedures != null) { for (int j = 0; j < target.sourceProcedures.Length; j++) { sourceProcedure source = target.sourceProcedures[j]; Element relationNode = new Element("relation"); Element sourceNode = new Element("source"); sourceNode.Add(new XAttribute("coordinate", source.coordinate)); if (!string.ReferenceEquals(source.owner, null)) { sourceNode.Add(new XAttribute("owner", source.owner)); } sourceNode.Add(new XAttribute("procedure", source.name)); Element targetNode = new Element("target"); targetNode.Add(new XAttribute("coordinate", target.coordinate)); if (!string.ReferenceEquals(target.owner, null)) { targetNode.Add(new XAttribute("owner", target.owner)); } targetNode.Add(new XAttribute("procedure", target.name)); relationNode.Add(sourceNode); relationNode.Add(targetNode); bool append = true; IEnumerator <Element> iter = dlineageRelation.Elements().GetEnumerator(); while (iter.MoveNext()) { if (iter.Current.Equals(relationNode)) { append = false; break; } } if (append) { dlineageRelation.Add(relationNode); } } } } } }
internal virtual void setProcedureDlinage(ProcedureMetaData procedureMetaData, TObjectName procedureName) { if (procedureMetaData == null) { return; } sourceProcedure sourceProcedure = new sourceProcedure(); sourceProcedure.name = procedureMetaData.DisplayName; sourceProcedure.owner = outerInstance.getOwnerString(procedureMetaData); sourceProcedure.coordinate = procedureName.startToken.lineNo + "," + procedureName.startToken.columnNo; sourceProcedure.highlightInfo = procedureName.startToken.offset + "," + (procedureName.endToken.offset - procedureName.startToken.offset + procedureName.endToken.astext.Length); List <sourceProcedure> sourceProcedureList = getSourceProcedureList(targetProcedure); sourceProcedureList.Add(sourceProcedure); targetProcedure.sourceProcedures = sourceProcedureList.ToArray(); }