public static void SetEvidence(this ILineData lineData, string sectionId, int year, string vertexKey, VertexEvidence vertexEvidence) { var sectionEvidence = lineData.GetEvidence(sectionId); if (vertexEvidence.Type == VertexEvidenceType.Null) { sectionEvidence[year][vertexKey] = null; } else { sectionEvidence[year][vertexKey] = vertexEvidence; } lineData.SetEvidence(sectionId, sectionEvidence); }
public static Dict <object, VertexEvidence> GetEvidence(this ILineData lineData, string sectionId, IEnumerable <int> years, string nodeKey) { var nodeEvidences = new Dict <object, VertexEvidence>(); var sectionEvidence = lineData.GetEvidence(sectionId); if (years == null) { years = sectionEvidence.Keys; } foreach (var year in years) { nodeEvidences[year] = sectionEvidence[year][nodeKey]; } return(nodeEvidences); }
public static Dict <object, VertexEvidence> GetEvidence(this ILineData lineData, IEnumerable <string> sectionIds, int year, string nodeKey) { var nodeEvidences = new Dict <object, VertexEvidence>(); if (sectionIds == null) { sectionIds = lineData.SectionIds; } foreach (var sectionId in sectionIds) { var sectionEvidence = lineData.GetEvidence(sectionId); nodeEvidences[sectionId] = sectionEvidence[year][nodeKey]; } return(nodeEvidences); }