Пример #1
0
        private DexTimelineEntry GetTimelineEntry(DateTime dateTime)
        {
            DexTimelineEntry candidate = wrapped.FirstOrDefault(x => x.MatchTimestamp(dateTime));

            if (candidate != null)
            {
                return(candidate);
            }

            candidate = new DexTimelineEntry(dateTime);
            wrapped.Add(candidate);
            return(candidate);
        }
Пример #2
0
        public bool KeepWithFilter(DexTimelineEntry dte)
        {
            if (!wrapped.Contains(dte))
            {
                return(false);
            }

            if (dte.SpecialGlucoseValueSpecified)
            {
                return(false);
            }

            int index = wrapped.IndexOf(dte);

            if (index < 3)
            {
                return(false);
            }

            if (index > (wrapped.Count - 3))
            {
                return(false);
            }

            for (int i = index - 3; i < index + 3; i++)
            {
                if (wrapped[i].CarbsSpecified)
                {
                    return(true);
                }
                if (wrapped[i].InsulinSpecified)
                {
                    return(true);
                }
                if (wrapped[i].MeterGlucoseSpecified)
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #3
0
 protected bool Equals(DexTimelineEntry other)
 {
     return(_timestamp.Equals(other._timestamp));
 }