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); }
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); }
protected bool Equals(DexTimelineEntry other) { return(_timestamp.Equals(other._timestamp)); }