Beispiel #1
0
        private void AddRelatedInstantPeriod(Member member, DateTime date, List <PeriodAspect> instantPeriodAspects, Uri role)
        {
            var aspect = instantPeriodAspects.SingleOrDefault(pa => ((InstantPeriod)pa.Period).Date == date);

            if (aspect != null)
            {
                var relatedAspect = new RelatedAspect(aspect, role);
                member.RelatedAspects.Add(relatedAspect);
            }
        }
Beispiel #2
0
        private Axis BuildUnitAxis(IList <Unit> units)
        {
            var textUnitAspect = new UnitAspect(TextUnit.Instance);
            var dimension      = Dimension.UnitDimension;
            var rootMembers    = new List <Member>();

            foreach (var unit in units)
            {
                var member = new Member(new UnitAspect(unit));

                // The text unit aspect is a related aspect in all unit members.
                var relatedAspect = new RelatedAspect(textUnitAspect, RelatedAspectRoles.Text);
                member.RelatedAspects.Add(relatedAspect);

                rootMembers.Add(member);
            }

            return(new Axis(dimension, dimension.Name, rootMembers));
        }