public SettingsViewModel() { _settings = Settings.Instance; VersionList = new ObservableCollection <Version>(_driver.GetVersions()); // 예약 시간 리스트 불러오기. foreach (DateTime time in _settings.ReservedTimes) { ReservedTimes.Add(time); } }
private void AddTime() { if (!ReservedTimes.Contains(SelectedTime)) { ReservedTimes.Add(SelectedTime); ReservedTimes = new ObservableCollection <DateTime>(ReservedTimes.OrderBy(time => time)); Settings.Instance.ReservedTimes = ReservedTimes.ToList(); Reports.Instance.AddReport(ReportType.Added, $"'{SelectedTime.Hour}:{SelectedTime.Minute}'에 갱신 예약이 추가되었습니다."); } else { MessageBox.Show("이미 같은 시간에 갱신 예약이 되어 있습니다.", "Bandit", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }