Ejemplo n.º 1
0
        public async Task SaveAsync(string filePath)
        {
            if (this.RaceManager == null)
            {
                throw new NullReferenceException(nameof(RaceManager));
            }

            await RaceData.WriteAsync(this.root, filePath);
        }
Ejemplo n.º 2
0
        public async Task InitAsync(string seasonFilePath)
        {
            GetBasePath(seasonFilePath);
            this.AthletesManager = new AthletesManager();
            await this.AthletesManager.PopulateWithParkrunList(this.basePath, false);

            this.root = await RaceData.ReadAsync(seasonFilePath);

            if (this.root == null)
            {
                throw new Exception($"Unable to set the root object from '{seasonFilePath}'");
            }

            var raceFinder = new Finder(this.root);

            this.RaceManager    = new RaceManager(raceFinder);
            this.RecordsManager = new RecordsManager(this.root.Records);
        }