Esempio n. 1
0
        private void TryAddItem(ActualDeath item)
        {
            if (this.m_Map.GetItemExact(item.JurisdictionId, item.Iteration, item.Timestep) != null)
            {
                string template =
                    "A duplicate death was detected: More information:" +
                    Environment.NewLine +
                    "Jurisdiction={0}, Iteration={1}, Timestep={2}";

                Shared.ThrowEpidemicException(template,
                                              this.GetJurisdictionName(item.JurisdictionId),
                                              MapBase.FormatValue(item.Iteration),
                                              MapBase.FormatValue(item.Timestep));
            }

            this.m_Map.AddItem(item.JurisdictionId, item.Iteration, item.Timestep, item);
            this.SetHasItems();
        }
Esempio n. 2
0
        private void TryAddItem(SymptomPeriod item)
        {
            try
            {
                this.AddItem(item.JurisdictionId, item.Iteration, item.Timestep, item);
            }
            catch (MapDuplicateItemException)
            {
                string template =
                    "A duplicate symptom period was detected: More information:" +
                    Environment.NewLine +
                    "Jurisdiction={0}, Iteration={1}, Timestep={2}";

                Shared.ThrowEpidemicException(template,
                                              this.GetJurisdictionName(item.JurisdictionId),
                                              MapBase.FormatValue(item.Iteration),
                                              MapBase.FormatValue(item.Timestep));
            }
        }