示例#1
0
        public Contest Load()
        {
            var repo    = new RatingsRepository(isoStore);
            var contest = repo.Load(fileName);

            if (contest != null)
            {
                KvrTrackListLoader.Shuffle(contest.Tracks, new Random());
            }
            return(contest);
        }
        public OpenContestWindowViewModel(IIsolatedStore store, IEnumerable <ContestInfo> knownContests)
        {
            this.Contests = new ObservableCollection <ContestInfo>();

            var repo = new RatingsRepository(store);

            foreach (var fileName in store.GetFileNames("*.xml"))
            {
                var c = repo.Load(fileName);
                this.Contests.Add(new ContestInfo()
                {
                    IsoStoreFileName = fileName, Name = c.Name, TrackListUrl = c.TrackListUrl
                });
            }

            AddKnownContests(knownContests);
        }