private void addBookmark_Click(object sender, RoutedEventArgs e) { if (SharedData.Sessions.CurrentSession.FollowedDriver.Driver.NumberPlate.Length > 0) { bool isSloMo = (bool)simulationAPI.GetData("ReplayPlaySlowMotion"); Bookmark ev = new Bookmark { BookmarkType = BookmarkTypes.Play, ReplayPos = (Int32)simulationAPI.GetData("ReplayFrameNum"), CamIdx = (Int32)simulationAPI.GetData("CamGroupNumber"), DriverIdx = SharedData.Sessions.CurrentSession.FollowedDriver.Driver.NumberPlatePadded, PlaySpeed = isSloMo ? (Int32)simulationAPI.GetData("ReplayPlaySpeed") : (Int32)simulationAPI.GetData("ReplayPlaySpeed") * (-1), Description = "Bookmark " + SharedData.Sessions.CurrentSession.FollowedDriver.Driver.Name, DriverName = SharedData.Sessions.CurrentSession.FollowedDriver.Driver.Name, Timestamp = TimeSpan.FromMilliseconds((Double)simulationAPI.GetData("SessionTime")) }; lock (SharedData.SharedDataLock) { SharedData.Bookmarks.SessionID = SharedData.Sessions.SessionId; SharedData.Bookmarks.SubSessionID = SharedData.Sessions.SubSessionId; SharedData.Bookmarks.List.Add(ev); } } }
void eventsGridDoubleClick(object sender, MouseButtonEventArgs e) { if (eventsGrid.SelectedItem != null) { Bookmark ev = new Bookmark((SessionEvent)eventsGrid.SelectedItem); ev.Rewind = this.getRewindTime(); replayThread = new Thread(rewind); replayThread.Start(ev); } }