コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonthSummaryViewModel"/> class.
 /// </summary>
 /// <param name="model">The first measurement for this month.</param>
 public MonthSummaryViewModel(Measurement measurement)
 {
     this.model = new MonthSummary();
     this.model.Month = new DateTime(measurement.DateTime.Year, measurement.DateTime.Month, 1);
     this.model.TotalMeasures = 1;
     this.model.TotalGlucose = measurement.GlucoseValue;
     this.model.TotalInsuline = measurement.InsulineUnits;
 }
コード例 #2
0
 public MeasurementViewModel()
 {
     this.model = new Measurement();
     this.model.DateTime = DateTime.Now;
 }
コード例 #3
0
 public MeasurementViewModel(Measurement model)
 {
     this.model = model;
 }
コード例 #4
0
 /// <summary>
 /// Removes the measurement.
 /// </summary>
 /// <param name="measurement">The measurement.</param>
 public void RemoveMeasurement(Measurement measurement)
 {
     this.Measurements.Remove(measurement);
 }
コード例 #5
0
 /// <summary>
 /// Adds the measurement.
 /// </summary>
 /// <param name="measurement">The measurement.</param>
 public void AddMeasurement(Measurement measurement)
 {
     this.Measurements.Add(measurement);
     this.Measurements.OrderBy(m => m.DateTime);
 }
コード例 #6
0
 /// <summary>
 /// Adds the measurement to the monthly summary and notify property changed.
 /// </summary>
 /// <param name="measurement">The measurement.</param>
 public void AddMeasurement(Measurement measurement)
 {
     this.model.TotalMeasures++;
     this.model.TotalGlucose += measurement.GlucoseValue;
     this.model.TotalInsuline += measurement.InsulineUnits;
     NotifyPropertyChanged("Glucose");
     NotifyPropertyChanged("Insuline");
 }