コード例 #1
0
        string getRemainingStartersList(RaceRun raceRun, string grouping, int limit)
        {
            string output = "";

            Application.Current.Dispatcher.Invoke(() =>
            {
                ViewConfigurator viewConfigurator = new ViewConfigurator(raceRun.GetRace());
                var vp = viewConfigurator.GetRemainingStartersViewProvider(raceRun);
                if (grouping != null)
                {
                    vp.ChangeGrouping(grouping);
                }

                List <object> remaingStarters = new List <object>();
                int c = 0;
                foreach (var item in vp.GetView())
                {
                    if (limit >= 0 && c >= limit)
                    {
                        break;
                    }

                    remaingStarters.Add(item);
                    c++;
                }

                output = JsonConversion.ConvertOnStartList(remaingStarters);
            });

            return(output);
        }
コード例 #2
0
        string getResultList(Race race, string grouping)
        {
            string output = "";

            Application.Current.Dispatcher.Invoke(() =>
            {
                ViewConfigurator viewConfigurator = new ViewConfigurator(race);
                RaceResultViewProvider vp         = viewConfigurator.GetRaceResultViewProvider(race);
                if (grouping != null)
                {
                    vp.ChangeGrouping(grouping);
                }

                output = JsonConversion.ConvertRaceResults(vp.GetView(), (uint)race.GetMaxRun());
            });

            return(output);
        }
コード例 #3
0
        string getStartList(RaceRun raceRun, string grouping)
        {
            string output = "";

            Application.Current.Dispatcher.Invoke(() =>
            {
                ViewConfigurator viewConfigurator = new ViewConfigurator(raceRun.GetRace());
                StartListViewProvider vp          = viewConfigurator.GetStartlistViewProvider(raceRun);
                if (grouping != null)
                {
                    vp.ChangeGrouping(grouping);
                }

                output = JsonConversion.ConvertStartList(vp.GetView());
            });

            return(output);
        }