private void InitializeClock() { try { var dt = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) }; dt.Tick += Dt_Tick; dt.Start(); var timerText = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(35) }; timerText.Tick += TimerText_Tick; timerText.Start(); DisplayDateBox.Content = DateTime.Now.ToString("dddd, dd MMMM yyyy"); DisplayNoticeBox.Content = _scheduleManager.Get("NoticeBangla"); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void NextAct() { IScheduleable scheduleable = ScheduleManager.Get(); if (scheduleable == null) { TickAll(); AddAll(); return; } System.Console.WriteLine("{0}", (scheduleable as Actor).GetParent().NAME); if ((scheduleable as Actor).GetParent() == Player) { IsPlayerTurn = true; } else { var ai = (scheduleable as Actor).GetComponent <ConsoleScreenGameHelper.Core.Entity.Components.AI>(ComponentType.AI); ai.Act(); (scheduleable as Actor).GetParent().Update(); if ((scheduleable as Actor).Stats.Energy >= 7) { ScheduleManager.Add((scheduleable as Actor)); } else if ((scheduleable as Actor).Stats.Energy > 0) { ScheduleManager.Add((scheduleable as Actor), 5); } else { ScheduleManager.Add((scheduleable as Actor), 7); } NextAct(); } }
public ISchedule GetSchedule(string name) { CronScheduleInfo info = ScheduleManager.Get(name); if (info == null) { return(null); } return(new CronSchedule(info)); }
private void BindUi() { FajrTimePicker.Text = _scheduleManager.Get("Fajr"); DurhTimePicker.Text = _scheduleManager.Get("Duhr"); AsrTimePicker.Text = _scheduleManager.Get("Asr"); MagribTimePicker.Text = _scheduleManager.Get("Magrib"); IshaTimePicker.Text = _scheduleManager.Get("Isha"); JummaTimePicker.Text = _scheduleManager.Get("Jumma"); NoticeTextBox.Text = _scheduleManager.Get("NoticeBangla"); if (_scheduleManager.Get("BgColor").Contains("Black")) { RadioBlack.IsChecked = true; } else { RadioLight.IsChecked = true; } }
public void ShowSchedule() { Schedules.Clear(); List <Schedule> schedules = _manager.Get(); foreach (Schedule schedule in schedules) { if (schedule is SchedulePeriod) { Schedules.Add(new SchedulePeriodViewModel((SchedulePeriod)schedule)); } else if (schedule is ScheduleReminder) { Schedules.Add(new ScheduleReminderViewModel((ScheduleReminder)schedule)); } else { Schedules.Add(new ScheduleViewModel(schedule)); } } }