private int GetSavedPage() { if (ChangeTracker.CurrentMatchOrRaceDay == null || ChangeTracker.CurrentSeasonOrRace == null) { return(0); } for (int i = 0; i < Races.Count; i++) { if (Races.ElementAt(i).LineObject.MatchExternalState.VirtualSeason.Value.ToString() == ChangeTracker.CurrentMatchOrRaceDay && GetRaceByRaceNumber(i) == ChangeTracker.CurrentSeasonOrRace) { return(i); } } return(0); }
private string GetRaceByRaceNumber(int raceNumber) { int currentseasonRaces = 0; long currentSeason = Races.ElementAt(raceNumber).LineObject.MatchExternalState.VirtualSeason.Value; currentseasonRaces = Races.Where(x => x.LineObject.MatchExternalState.VirtualSeason.Value == currentSeason) .Max(x => x.LineObject.MatchExternalState.VirtualDay.Value); //foreach (IMatchVw match in Races) //{ // if (match.LineObject.MatchExternalState.VirtualSeason.Value == currentSeason) // currentseasonRaces = match.LineObject.MatchExternalState.VirtualDay.Value; //} return(Races.ElementAt(raceNumber).LineObject.MatchExternalState.VirtualDay.Value.ToString() + "/" + currentseasonRaces.ToString()); }