Beispiel #1
0
 private void AddCustomRequest_button_Click(object sender, EventArgs e)
 {
     monotypeActions1();
     startTime = DateTime.Parse("2015/01/01 " + startTime_textBox.Text);
     endTime = DateTime.Parse("2015/01/01 " + endTime_textBox.Text);
     if (endTime < startTime)
         throw new Exception("Время окончания не может быть меньше начального, так как перенос на следующие сутки не допускается");
     request = new Request(startTime, endTime);
     monotypeActions2();
 }
Beispiel #2
0
 private void AddRequest_button_Click(object sender, EventArgs e)
 {
     monotypeActions1();
     Random rnd = new Random();
     startTime = new DateTime(2015, 1, 1, rnd.Next(0, 24), rnd.Next(0, 60), 0);
     endHour = rnd.Next(startTime.Hour, 24);
     if (startTime.Hour == 23)
         endMinute = rnd.Next(startTime.Minute + 1, 61);
     else
         endMinute = rnd.Next(0, 60);
     if ((startTime.Minute >= endMinute) && (startTime.Hour == endHour) && (startTime.Hour != 23))
         endHour++;
     endTime = new DateTime(2015, 1, 1, endHour, endMinute, 0);
     request = new Request(startTime, endTime);
     monotypeActions2();
 }
Beispiel #3
0
 private void Stream()
 {
     for (int i = 0; act; i++)
     {
         monotypeActions1();
         Random rnd = new Random();
         startTime = new DateTime(2015, 1, 1, rnd.Next(0, 24), rnd.Next(0, 60), 0);
         endHour = rnd.Next(startTime.Hour, 24);
         if (startTime.Hour == 23)
             endMinute = rnd.Next(startTime.Minute + 1, 61);
         else
             endMinute = rnd.Next(0, 60);
         if ((startTime.Minute >= endMinute) && (startTime.Hour == endHour) && (startTime.Hour != 23))
             endHour++;
         endTime = new DateTime(2015, 1, 1, endHour, endMinute, 0);
         request = new Request(startTime, endTime);
         monotypeActions2();
         Thread.Sleep(new TimeSpan(0, 0, 3));
         Application.DoEvents();
     }
 }