/// <summary> /// Initialises a new instance of the <see cref="AthleteData"/> class. /// </summary> /// <param name="generalIo">general IO manager</param> /// <param name="logger">application logger</param> public AthleteData( IGeneralIo generalIo, INormalisationConfigMngr normalisationConfigManager, ISeriesConfigMngr seriesConfigManager, IJHcLogger logger) { this.generalIo = generalIo; this.logger = logger; this.athleteDataReader = new AthleteDataReader( normalisationConfigManager, seriesConfigManager, this.logger); this.athleteSeasonDataReader = new AthleteSeasonDataReader( this.logger); string rootDirectory = RootIO.LoadRootFile(); this.dataPath = $"{rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.dataPath}{Path.DirectorySeparatorChar}"; Messenger.Default.Register <ReinitialiseRoot>(this, this.ReinitialiseRoot); }
/// <summary> /// Reinitialise the data path value from the file. /// </summary> /// <param name="message">reinitialise message</param> private void ReinitialiseRoot(ReinitialiseRoot message) { this.ModelRootDirectory = RootIO.LoadRootFile(); }
/// <summary> /// A reinitialise root message has been received. /// </summary> /// <param name="message">reinitialise root message</param> public void ReinitialiseRoot(ReinitialiseRoot message) { string rootDirectory = RootIO.LoadRootFile(); this.dataPath = $"{rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.dataPath}{Path.DirectorySeparatorChar}"; }
/// <summary> /// Reinitialise the data path value from the file. /// </summary> /// <param name="message">reinitialise message</param> private void ReinitialiseRoot(ReinitialiseRoot message) { this.rootDirectory = RootIO.LoadRootFile(); this.dataPath = $"{this.rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.dataPath}{Path.DirectorySeparatorChar}"; this.configurationPath = $"{this.rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.configurationPath}{Path.DirectorySeparatorChar}"; }