public void InitLapEventCompletion(LapViewControl.LapDetailItem item)
        {
            this.lblTitle.Text = "Lap Completed";

            ucEventView.InitLapEventCompletion(item);

            this.SecondsUntilAutoClose = 9;
            btnClose.Text = this.SecondsUntilAutoClose.ToString();

            this.CountdownTimer.Enabled = true;
        }
 private static string[] SubItemStrings(LapViewControl.LapDetailItem item, MeasurementSystemType roadUom, MeasurementSystemType powerUom)
 {
     return(new string[]
     {
         "", // dummy first column
         item.LapNumber.ToString(),
         $"{item.LapTime.Minutes:0#}:{item.LapTime.Seconds:0#}",
         roadUom == MeasurementSystemType.Metric ? $"{item.LapSpeedKph:0.0}" : $"{item.LapSpeedMph:0.0}",
         roadUom == MeasurementSystemType.Metric ? $"{item.LapDistanceKm:0.0}" : $"{item.LapDistanceMi:0.0}",
         powerUom == MeasurementSystemType.Metric ? $"{item.LapAvgWkg:0.00}" : $"{item.LapAvgWatts}",
         $"{item.TotalTime.Hours:0#}:{item.TotalTime.Minutes:0#}:{item.TotalTime.Seconds:0#}"
     });
 }
示例#3
0
        public void InitLapEventCompletion(LapViewControl.LapDetailItem item)
        {
            this.lvHeader.Columns.Clear();
            this.lvDetail.Columns.Clear();
            this.lvDetail.Items.Clear();

            this.lvHeader.Columns.AddRange(new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Text = "", Width = 0
                },
                new ColumnHeader()
                {
                    Text = "Lap", TextAlign = HorizontalAlignment.Center, Width = 242
                },
                new ColumnHeader()
                {
                    Text = "Total", TextAlign = HorizontalAlignment.Center, Width = 72
                },
            });

            this.lvDetail.Columns.AddRange(new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Text = "", Width = 0
                },
                new ColumnHeader()
                {
                    Text = "#", TextAlign = HorizontalAlignment.Center, Width = 28
                },
                new ColumnHeader()
                {
                    Text = "Time", TextAlign = HorizontalAlignment.Center, Width = 66
                },
                new ColumnHeader()
                {
                    Text = "km/h", TextAlign = HorizontalAlignment.Center, Width = 48
                },
                new ColumnHeader()
                {
                    Text = "km", TextAlign = HorizontalAlignment.Center, Width = 50
                },
                new ColumnHeader()
                {
                    Text = "Avg", TextAlign = HorizontalAlignment.Center, Width = 50
                },
                new ColumnHeader()
                {
                    Text = "Time", TextAlign = HorizontalAlignment.Center, Width = 72
                },
            });

            this.CurrentPowerUom = MeasurementSystemType.Imperial;
            this.lvDetail.Items.Add(new LapViewControl.LapListViewItem(item, ZAMsettings.Settings.Laps.MeasurementSystemSetting, this.CurrentPowerUom));

            LapViewControl.LapListViewItem.RefreshAll(lvDetail, ZAMsettings.Settings.Laps.MeasurementSystemSetting, this.CurrentPowerUom);

            this.TimerTicks             = 0;
            this.CountdownTimer.Enabled = true;
        }
 public LapListViewItem(LapViewControl.LapDetailItem item, MeasurementSystemType roadUom, MeasurementSystemType powerUom) : base(SubItemStrings(item, roadUom, powerUom))
 {
     this.LapItem = item;
     this.Name    = item.LapNumber.ToString(); // this is the Key in the listview.items collection
 }