internal Scheduler() { ManuallyScheduled = false; StartTime = DateTime.Now; EndTime = DateTime.Now.AddYears(1); BotPath = AppDomain.CurrentDomain.BaseDirectory; BreakObject = new BottingBreak(); }
private void MakeBreak() { var r = new Random(); var breakObject = new BottingBreak { TimeSinceLastBreak = DateTime.Now, TimeSpanInterval = new TimeSpan(0, (int) numericUpDown1.Value, 0), TimeSpanToAddToLastBreak = new TimeSpan(0, r.Next(0, (int) numericUpDown2.Value), 0), TimeSpanToPause = new TimeSpan(0, (int) numericUpDown3.Value, 0), TimeSpanToWaitLonger = new TimeSpan(0, r.Next(0, (int) numericUpDown4.Value), 0), BreakEnabled = chkBoxEnableBreak.Checked, }; breakObject.TimeActualStartBreak = breakObject.TimeSinceLastBreak + breakObject.TimeSpanInterval + breakObject.TimeSpanToAddToLastBreak; breakObject.TimeActualStopBreak = breakObject.TimeActualStartBreak + breakObject.TimeSpanToPause + breakObject.TimeSpanToWaitLonger; Scheduler wanted = Config.Singleton.SchedulerSettings.FirstOrDefault(s => s.Account.LoginName == _account.LoginName); if (wanted != null) { wanted.SetBreak(breakObject); } }
internal void SetBreak(BottingBreak newBreak) { BreakObject = newBreak; }