/// <summary> /// Initialises a new instance of the <see cref="GeneralIO"/> class. /// </summary> /// <param name="logger"></param> public GeneralIO( IJHcLogger logger) { this.logger = logger; this.rootDirectory = RootIO.LoadRootFile(); this.dataPath = $"{this.rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.dataPath}{Path.DirectorySeparatorChar}"; this.configurationPath = $"{this.rootDirectory}{Path.DirectorySeparatorChar}{IOPaths.configurationPath}{Path.DirectorySeparatorChar}"; Messenger.Default.Register <ReinitialiseRoot>(this, this.ReinitialiseRoot); }
/// <summary> /// Initialises a new instance of the <see cref="BLMngr"/> class. /// </summary> /// <param name="model">junior handicap model</param> /// <param name="normalisationConfigurationManager">the normalisation config manager</param> /// <param name="resultsConfigurationManager">the results config manager</param> /// <param name="seriesConfigurationManager">the series config manager</param> /// <param name="athleteData">athlete data</param> /// <param name="clubData">club data</param> /// <param name="eventData">event data</param> /// <param name="summaryData">summary data</param> /// <param name="seasonIO">season IO manager</param> /// <param name="eventIo">event IO manager</param> /// <param name="generalIo">general IO manager</param> /// <param name="logger">application logger</param> public BLMngr( IModel model, INormalisationConfigMngr normalisationConfigurationManager, IResultsConfigMngr resultsConfigurationManager, ISeriesConfigMngr seriesConfigurationManager, IAthleteData athleteData, IClubData clubData, IEventData eventData, ISummaryData summaryData, ISeasonIO seasonIO, IEventIo eventIo, IGeneralIo generalIo, IJHcLogger logger) { this.logger = logger; this.model = model; this.normalisationConfigurationManager = normalisationConfigurationManager; this.resultsConfigurationManager = resultsConfigurationManager; this.seriesConfigurationManager = seriesConfigurationManager; this.athleteData = athleteData; this.clubData = clubData; this.eventData = eventData; this.summaryData = summaryData; this.seasonIO = seasonIO; this.eventIo = eventIo; this.generalIo = generalIo; this.ModelRootDirectory = RootIO.LoadRootFile(); this.currentSeason = string.Empty; this.resultsCalculator = new CalculateResultsMngr( this.model, this.normalisationConfigurationManager, this.resultsConfigurationManager, this.seriesConfigurationManager, this.logger); this.IsValid = this.generalIo.DataFolderExists && this.generalIo.ConfigurationFolderExists; Messenger.Default.Register <LoadNewSeasonMessage>(this, this.NewCurrentSeason); Messenger.Default.Register <LoadNewEventMessage>(this, this.NewCurrentEvent); Messenger.Default.Register <LoadNewSeriesMessage>(this, this.LoadNewSeries); Messenger.Default.Register <CreateNewSeriesMessage>(this, this.CreateNewSeries); Messenger.Default.Register <ReinitialiseRoot>(this, this.ReinitialiseRoot); }
/// <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> /// 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.ModelRootDirectory = RootIO.LoadRootFile(); }
/// <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}"; }