EraYear() public method

This function returns the year of the era and sets the era in an output parameter.
/// The exception is thrown if date is outside of the time /// span of the era. ///
public EraYear ( int &era, int date ) : int
era int An output parameter returning the /// era number. ///
date int An integer giving the fixed day /// number. ///
return int
コード例 #1
0
        public int EraYear(out int era, int date)
        {
            IList valueList = this._Eras.GetValueList();

            foreach (object obj in valueList)
            {
                CCGregorianEraHandler.Era era2 = (CCGregorianEraHandler.Era)obj;
                if (era2.Covers(date))
                {
                    return(era2.EraYear(out era, date));
                }
            }
            throw new ArgumentOutOfRangeException("date", "Time value was out of era range.");
        }