public void SetBreak(BreakObject newBreak) { BreakObject = newBreak; BreakObject.LoginName = LoginName; }
private void MakeBreak() { var r = new Random(); var breakObject = new BreakObject { 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 = metroToggle1.Checked, Interval = (int) numericUpDown1.Value, IntervalDelay = (int) numericUpDown2.Value, BreakDuration = (int) numericUpDown3.Value, BreakDurationDelay = (int) numericUpDown4.Value, }; breakObject.TimeActualStartBreak = breakObject.TimeSinceLastBreak + breakObject.TimeSpanInterval + breakObject.TimeSpanToAddToLastBreak; breakObject.TimeActualStopBreak = breakObject.TimeActualStartBreak + breakObject.TimeSpanToPause + breakObject.TimeSpanToWaitLonger; _account.SetBreak(breakObject); }
public void SetBreak(BreakObject newBreak) { BreakObject = newBreak; BreakObject.LoginName = LoginName; }