Пример #1
0
        /// <summary>Loads the covid data from text.</summary>
        /// <param name="textContent">Content of the text.</param>
        /// <exception cref="ArgumentNullException">textContent</exception>
        public void LoadCovidData(string textContent)
        {
            textContent = textContent ?? throw new ArgumentNullException(nameof(textContent));
            var parser = new CovidCsvParser(textContent);

            this.covidErrorLogger            = parser.CovidErrorLogger;
            this.FilteredCovidDataCollection = parser.GenerateCovidDataCollection();
            this.AllCovidData      = this.FilteredCovidDataCollection.Clone();
            this.IsCovidDataLoaded = true;
            this.buildCovidSummary();
        }
Пример #2
0
        /// <summary>
        ///     Merges the and loads the covid data using csv content.
        /// </summary>
        /// <param name="textContent">Content of the text.</param>
        /// <param name="mergeAllStates">if set to <c>true</c> [merge all states].</param>
        /// <exception cref="ArgumentNullException">textContent</exception>
        public void MergeAndLoadCovidData(string textContent, bool mergeAllStates)
        {
            textContent = textContent ?? throw new ArgumentNullException(nameof(textContent));
            var parser = new CovidCsvParser(textContent);
            var newCovidDataCollection = parser.GenerateCovidDataCollection();

            this.covidErrorLogger = parser.CovidErrorLogger;
            if (mergeAllStates)
            {
                this.FilteredCovidDataCollection = this.AllCovidData.Clone();
            }

            this.mergeController = new CovidDataMergeController(this.FilteredCovidDataCollection,
                                                                newCovidDataCollection);
            this.mergeController.AddAllNonDuplicates();
            this.mergeAndRebuildAllCovidData();
        }