コード例 #1
0
ファイル: Scheduler.cs プロジェクト: Vipeax/GW2WinMan
 internal Scheduler()
 {
     ManuallyScheduled = false;
     StartTime = DateTime.Now;
     EndTime = DateTime.Now.AddYears(1);
     BotPath = AppDomain.CurrentDomain.BaseDirectory;
     BreakObject = new BottingBreak();
 }
コード例 #2
0
ファイル: ManageBreaks.cs プロジェクト: Vipeax/GW2WinMan
        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);
            }
        }
コード例 #3
0
ファイル: Scheduler.cs プロジェクト: Vipeax/GW2WinMan
 internal void SetBreak(BottingBreak newBreak)
 {
     BreakObject = newBreak;
 }