示例#1
0
文件: BLMngr.cs 项目: abs508/jHc
        /// <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);
        }
示例#2
0
        /// <summary>
        /// Prevents a new instance of the HandicapModel class from being created.
        /// </summary>
        /// <param name="normalisationConfigMngr">Normalisation configuration manager</param>
        /// <param name="resultsConfigurationManager">Results configuration 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="resultsTableReader">results table reader</param>
        /// <param name="seasonIo">season IO Manager</param>
        /// <param name="eventIo">event IO manager</param>
        /// <param name="rawEventIo">raw event IO manager</param>
        /// <param name="generalIo">general IO manager</param>
        /// <param name="logger">application logger</param>
        public Model(
            INormalisationConfigMngr normalisationConfigMngr,
            IResultsConfigMngr resultsConfigurationManager,
            IAthleteData athleteData,
            IClubData clubData,
            IEventData eventData,
            ISummaryData summaryData,
            IResultsTableReader resultsTableReader,
            ISeasonIO seasonIo,
            IEventIo eventIo,
            IRawEventIo rawEventIo,
            IGeneralIo generalIo,
            IJHcLogger logger)
        {
            this.normalisationConfigurationManager = normalisationConfigMngr;
            this.resultsConfigurationManager       = resultsConfigurationManager;
            this.athleteData = athleteData;
            this.clubData    = clubData;
            this.summaryData = summaryData;
            this.eventIo     = eventIo;
            this.seasonIo    = seasonIo;
            this.logger      = logger;

            // Setup local models.
            this.CurrentSeason =
                new Season(
                    resultsConfigurationManager,
                    this.athleteData,
                    this.clubData,
                    this.summaryData,
                    this.eventIo,
                    this.logger);
            this.CurrentEvent =
                new EventHC(
                    eventData,
                    this.summaryData,
                    resultsTableReader,
                    rawEventIo,
                    this.logger);
            this.Seasons       = seasonIo.GetSeasons();
            this.Athletes      = this.athleteData.ReadAthleteData();
            this.Clubs         = this.clubData.LoadClubData();
            this.GlobalSummary = this.summaryData.LoadSummaryData();

            Messenger.Default.Register <LoadNewSeriesMessage>(this, this.LoadNewSeries);
        }
示例#3
0
文件: Season.cs 项目: abs508/jHc
        /// <summary>
        /// Initialises a new instance of the <see cref="Season"/> class
        /// </summary>
        /// <param name="resultsConfigurationManager">
        ///  The results configuration manager
        /// </param>
        /// <param name="athleteData">athlete data</param>
        /// <param name="clubData">club data</param>
        /// <param name="summaryData">summary data</param>
        /// <param name="eventIo">event IO manager</param>
        /// <param name="logger">application logger</param>
        public Season(
            IResultsConfigMngr resultsConfigurationManager,
            IAthleteData athleteData,
            IClubData clubData,
            ISummaryData summaryData,
            IEventIo eventIo,
            IJHcLogger logger)
        {
            this.resultsConfigurationManager = resultsConfigurationManager;
            this.athleteData = athleteData;
            this.clubData    = clubData;
            this.summaryData = summaryData;
            this.eventIo     = eventIo;
            this.logger      = logger;

            this.athletes = new List <IAthleteSeasonDetails>();
            this.clubs    = new List <IClubSeasonDetails>();
            this.summary  = new Summary();
            this.events   = new List <string>();

            Messenger.Default.Register <LoadNewSeasonMessage>(this, this.LoadNewSeason);
        }