예제 #1
0
        // *************************** internal members ********************************
        /// <summary>
        ///		Add a year to the year list, setting the current weeek of that year at the
        ///		same time.  This is an internal function that can only be called by objects
        ///		within the Rabies_Model_Core namespace.
        /// </summary>
        /// <param name="WinterType">The winter type of the new year.</param>
        /// <param name="CurrentWeek">
        ///		The current week of the new year.  An ArgumentOutOfRangeException exception is
        ///		raised if the value of CurrentWeek is not between 1 and 52.
        ///	</param>
        /// <returns>A reference to the new year.</returns>
        internal cYear Add(enumWinterType WinterType, int CurrentWeek)
        {
            // create the year
            cYear NewYear = new cYear(Values.Count, WinterType);

            NewYear.SetCurrentWeek(CurrentWeek);
            // add the year to the list
            Values.Add(NewYear);
            // return the newly create year
            return(NewYear);
        }
예제 #2
0
        /// <summary>
        ///		Set the current year and week.  This is an internal function that can only be
        ///		called by objects within the Rabies_Model_Core namespace.
        /// </summary>
        /// <param name="CurrentYear">
        ///		The new current year.  An ArgumentOutOfRange Exception is raised if this value
        ///		is less than 0 or greater than the number of years minus one.
        /// </param>
        /// <param name="CurrentWeek">
        ///		The current week for the new current year.  An ArgumentOutOfRangeException
        ///		exception is raised if the value of CurrentWeek is not between 1 and 52.
        /// </param>
        internal void SetYearAndWeek(int CurrentYear, int CurrentWeek)
        {
            // make sure the current year exists in the list
            if (CurrentYear > Values.Count - 1)
            {
                throw new ArgumentOutOfRangeException("CurrentYear",
                                                      "The value of CurrentYear cannot exceed the number of years in the list");
            }
            // set the current year
            mvarCurrentYearNum = CurrentYear;
            // set the current week
            cYear TheYear = Values[mvarCurrentYearNum];

            TheYear.SetCurrentWeek(CurrentWeek);
        }