Ejemplo n.º 1
0
 private void DateRangeShowButton_Click(object sender, EventArgs e)
 {
     frmTemporalExpressionTest testForm = new frmTemporalExpressionTest();
     ITemporalExpression temporalExpression = TemporalExpressionFactory.CreateFromString(string.Format("DRNG({0},{1})",
         DateRangeStartDateTimePicker.Value,
         DateRangeEndDateTimePicker.Value));
     testForm.TemporalExpression = temporalExpression;
     testForm.Title = "Date range: " + temporalExpression.ToString();
     testForm.Description = "DRNG(start, end) Every day betweek two given dates.";
     testForm.ShowDialog();
 }
Ejemplo n.º 2
0
 private void DateUnitShowButton_Click(object sender, EventArgs e)
 {
     frmTemporalExpressionTest testForm = new frmTemporalExpressionTest();
     ITemporalExpression temporalExpression = TemporalExpressionFactory.CreateFromString(string.Format("DUNT({0},{1},{2},{3})",
         int.Parse(DateUnitUnitNumberNumericUpDown.Value.ToString()),
         DateUnits.GetKey(DateUnitUnitcomboBox.SelectedIndex).ToString(),
         DateUnitUnitStartDateTimePicker.Value,
         GetTimeSpamFromAmount(DateUnitUnitAmountComboBox.SelectedIndex)));
     testForm.TemporalExpression = temporalExpression;
     testForm.Title = "Date UNIT: " + temporalExpression.ToString();
     testForm.Description = "DUNT(n,unit, start, amount) Every n unit from star two by time amount.";
     testForm.ShowDialog();
 }
Ejemplo n.º 3
0
        private void DOTMShowButton_Click(object sender, EventArgs e)
        {
            frmTemporalExpressionTest testForm = new frmTemporalExpressionTest();
            ITemporalExpression temporalExpression =
                TemporalExpressionFactory.CreateFromString("DOTM(" +
                this.DOTMNumberNumericUpDown.Value.ToString() +
                (this.DOTMDayCheckBox.Checked? "," + ((int)((DayOfWeek)this.DOTMDayComboBox.SelectedItem)).ToString() : "") + ")");
            testForm.TemporalExpression = temporalExpression;
            testForm.Title = "Day of the month: " + temporalExpression.ToString();

            string[] dayNames = Enum.GetNames(typeof(DayOfWeek));
            string dayNamesList = "";
            for (int i = 0; i < dayNames.Length; i++)
            {
                dayNamesList += i.ToString() + "-" + dayNames[i] + " ";
            }
            testForm.Description = "DOTM(n<,d>) Every n-number < d-day of the week* > of every month.  A negative value of n means reverse counting.\n" +
                "*: " + dayNamesList;
            testForm.ShowDialog();
        }
Ejemplo n.º 4
0
 private void WOTYShowButton_Click(object sender, EventArgs e)
 {
     frmTemporalExpressionTest testForm = new frmTemporalExpressionTest();
     ITemporalExpression temporalExpression =
         TemporalExpressionFactory.CreateFromString("WOTY(" +
         this.WOTYNumberNumericUpDown.Value.ToString() +
         (this.WOTYMonthCheckBox.Checked ? "," + ((int)(this.WOTYMonthComboBox.SelectedIndex + 1)).ToString() : "") + ")");
     testForm.TemporalExpression = temporalExpression;
     testForm.Title = "Week of the year: " + temporalExpression.ToString();
     testForm.Description = "WOTY(n<,m>) Every n-number < m-month > of every year.  A negative value of n means reverse counting.";
     testForm.ShowDialog();
 }