コード例 #1
0
ファイル: TimeInterval.cs プロジェクト: Atiragram/poit-labs
        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);
        }
コード例 #2
0
 private void setDateButton_Click(object sender, EventArgs e)
 {
     sourceTimeInterval = intervalTypesList[sourceTypeDateInput.SelectedIndex];
     sourceTimeInterval.SetSourceTimeInterval((int) sourceCountInput.Value, (int) sourceMultiplierInput.Value);
     convertDateButton.Enabled = true;
 }