public void Calculate(int multiplier, TimeInterval interval) { ResetTime(); DateTime tempDateTime = currentTime; int periodsCount = 0; outTime = this.SubstractUnit(currentTime, sourceCount, sourceMultiplier); while (tempDateTime > outTime) { tempDateTime = interval.SubstractUnit(tempDateTime, 1, multiplier); periodsCount++; } newCount = periodsCount; newDate = interval.SubstractUnit(currentTime, newCount, multiplier); }
private void setDateButton_Click(object sender, EventArgs e) { sourceTimeInterval = intervalTypesList[sourceTypeDateInput.SelectedIndex]; sourceTimeInterval.SetSourceTimeInterval((int) sourceCountInput.Value, (int) sourceMultiplierInput.Value); convertDateButton.Enabled = true; }