예제 #1
0
        private void PopulateInsulinDataPoints()
        {
            foreach (var insulin in Insulins)
            {
                InsulinDataPoints.Add(insulin.GetDataPoint());
            }

            InsulinDataPoints.Sort(point => point.X);
        }
예제 #2
0
        public void AddInsulinDatapoint(DataPoint point)
        {
            var item = InsulinDataPoints.FirstOrDefault(p => p.X > point.X);

            if (item.Equals(new DataPoint()))
            {
                InsulinDataPoints.Add(point);
            }
            else
            {
                var index = InsulinDataPoints.IndexOf(item);
                InsulinDataPoints.Insert(index, point);
            }
        }