当前位置: 首页>>代码示例>>C#>>正文


C# ViewModel.SetSector1Time方法代码示例

本文整理汇总了C#中ViewModel.SetSector1Time方法的典型用法代码示例。如果您正苦于以下问题:C# ViewModel.SetSector1Time方法的具体用法?C# ViewModel.SetSector1Time怎么用?C# ViewModel.SetSector1Time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ViewModel的用法示例。


在下文中一共展示了ViewModel.SetSector1Time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateCar

        private void UpdateCar(ViewModel.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)
            {
//.........这里部分代码省略.........
开发者ID:visual14ph,项目名称:f1livetiming,代码行数:101,代码来源:App.xaml.cs


注:本文中的ViewModel.SetSector1Time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。