本文整理汇总了C#中ViewModels.SetSector1Time方法的典型用法代码示例。如果您正苦于以下问题:C# ViewModels.SetSector1Time方法的具体用法?C# ViewModels.SetSector1Time怎么用?C# ViewModels.SetSector1Time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewModels
的用法示例。
在下文中一共展示了ViewModels.SetSector1Time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCar
private void UpdateCar(ViewModels.CarViewModel car, F1.Messages.ICarMessage msg)
{
if (msg is F1.Messages.Car.CarDriver)
{
F1.Messages.Car.CarDriver carDriver = (F1.Messages.Car.CarDriver)msg;
if (carDriver.Name != "")
{
car.DriverName = carDriver.Name;
try
{
MainViewModel.DriversNames.Add(Converters.DriverNameConverter.Shorten(carDriver.Name), carDriver.Name);
}
catch (ArgumentException)
{
//such key already exists
}
}
car.DriverNameColor = GetColor(msg.Colour);
}
if (msg is F1.Messages.Car.CarInterval)
{
F1.Messages.Car.CarInterval carInt = (F1.Messages.Car.CarInterval)msg;
car.SetInterval(carInt.Interval, carInt.IntervalType, GetColor(msg.Colour));
MainViewModel.UpdateGaps(car.TablePosition);
}
if (msg is F1.Messages.Car.CarLapTime)
{
F1.Messages.Car.CarLapTime carLapTime = (F1.Messages.Car.CarLapTime)msg;
car.SetLapTime(carLapTime.LapTime, carLapTime.LapTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.CarLapCount)
{
F1.Messages.Car.CarLapCount lapCount = (F1.Messages.Car.CarLapCount)msg;
car.LapCountSet = lapCount.LapCount;
car.LapCountColor = GetColor(msg.Colour);
}
if (msg is F1.Messages.Car.CarPitCount)
{
F1.Messages.Car.CarPitCount pitCount = (F1.Messages.Car.CarPitCount)msg;
car.PitCountSet = pitCount.Count;
car.PitCountColor = GetColor(msg.Colour);
}
if (msg is F1.Messages.Car.CarSectorTime1)
{
F1.Messages.Car.CarSectorTime1 sect1 = (F1.Messages.Car.CarSectorTime1)msg;
car.SetSector1Time(sect1.SectorTime, sect1.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.CarSectorTime2)
{
F1.Messages.Car.CarSectorTime2 sect2 = (F1.Messages.Car.CarSectorTime2)msg;
car.SetSector2Time(sect2.SectorTime, sect2.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.CarSectorTime3)
{
F1.Messages.Car.CarSectorTime3 sect3 = (F1.Messages.Car.CarSectorTime3)msg;
car.SetSector3Time(sect3.SectorTime, sect3.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.CarNumber)
{
F1.Messages.Car.CarNumber carNum = (F1.Messages.Car.CarNumber)msg;
car.CarNumberSet = carNum.Number;
car.CarNumberColor = GetColor(msg.Colour);
}
if (msg is F1.Messages.Car.PracticeBestLapTime)
{
F1.Messages.Car.PracticeBestLapTime lapTime = (F1.Messages.Car.PracticeBestLapTime)msg;
car.SetBestPracticeLapTime(lapTime.BestLap, lapTime.BestLapType, GetColor(msg.Colour));
car.BestPracticeLapTimeColor = GetColor(lapTime.Colour);
}
if (msg is F1.Messages.Car.QualifyPeriodTime1)
{
F1.Messages.Car.QualifyPeriodTime1 q1Time = (F1.Messages.Car.QualifyPeriodTime1)msg;
car.SetQ1Time(q1Time.SectorTime, q1Time.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.QualifyPeriodTime2)
{
F1.Messages.Car.QualifyPeriodTime2 q2Time = (F1.Messages.Car.QualifyPeriodTime2)msg;
car.SetQ2Time(q2Time.SectorTime, q2Time.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.QualifyPeriodTime3)
{
F1.Messages.Car.QualifyPeriodTime3 q3Time = (F1.Messages.Car.QualifyPeriodTime3)msg;
car.SetQ3Time(q3Time.SectorTime, q3Time.SectorTimeType, GetColor(msg.Colour));
}
if (msg is F1.Messages.Car.CarPosition)
{
//.........这里部分代码省略.........