/// <summary> /// Initialises a new instance of the <see cref="SessionModel"/> class. /// </summary> public SessionModel() { InnerDrivers = new SortableObservableCollection<DriverModel>((x, y) => { return x.Position.CompareTo(y.Position); }); Drivers = new ReadOnlyObservableCollection<DriverModel>(InnerDrivers); DriversById = new Dictionary<int, DriverModel>(25); Feed = new FeedModel(); Grid = GridModelBase.Create(SessionType.None); FastestTimes = new FastestTimesModel(this); Messages = new MessageModel(); OneSecondTimer = new DispatcherTimer(DispatcherPriority.Normal); OneSecondTimer.Interval = OneSecond; OneSecondTimer.Tick += (s, e) => OnOneSecondElapsed(); SessionStatus = SessionStatus.Finished; SpeedCaptures = new SpeedCapturesModel(this); Weather = new WeatherModel(); Builder = new SessionModelBuilder(this); }
/// <summary> /// Initialises a new instance of the <see cref="SpeedCapturesModelBuilder"/> class and specifies /// the <paramref name="model"/> to build. /// </summary> /// <param name="model">The model to build.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="model"/> is <see langword="null"/>. /// </exception> public SpeedCapturesModelBuilder(SpeedCapturesModel model) { Guard.NotNull(model, "model"); Model = model; }