public override DateTime AddYears(DateTime time, int years)
{
int datePart = this.GetDatePart(time.Ticks, 0);
int month = this.GetDatePart(time.Ticks, 2);
int day = this.GetDatePart(time.Ticks, 3);
datePart += years;
this.CheckHebrewYearValue(datePart, 0, "years");
int monthsInYear = this.GetMonthsInYear(datePart, 0);
if (month > monthsInYear)
{
month = monthsInYear;
}
int daysInMonth = this.GetDaysInMonth(datePart, month);
if (day > daysInMonth)
{
day = daysInMonth;
}
long ticks = this.ToDateTime(datePart, month, day, 0, 0, 0, 0).Ticks + (time.Ticks % 0xc92a69c000L);
Calendar.CheckAddResult(ticks, this.MinSupportedDateTime, this.MaxSupportedDateTime);
return(new DateTime(ticks));
}