예제 #1
0
파일: Extensions.cs 프로젝트: sandy70/Marv
        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);
        }
예제 #2
0
파일: Extensions.cs 프로젝트: sandy70/Marv
        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);
        }
예제 #3
0
파일: Extensions.cs 프로젝트: sandy70/Marv
        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);
        }