private void btnAlwaysNotify_CheckedChanged(object sender, EventArgs e) { NotifySettings settings = NotifySettings.ReadSettings(); settings.NotifyAlways = btnAlwaysNotify.Checked; settings.SaveSettings(); }
private bool NeedNotify() { NotifySettings settings = NotifySettings.ReadSettings(); if (settings.NotifyAlways || DateTime.Now.TimeOfDay <= settings.WorkdayStart.TimeOfDay || DateTime.Now.TimeOfDay >= settings.WorkdayFinish.TimeOfDay || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday || settings.NotifyDays.Contains(DateTime.Today) || IsVacationDate(DateTime.Today)) { return(true); } else { return(false); } }
private void PlayNotifySound() { string soundFile = NotifySettings.ReadSettings().NotifySoundFile; if (soundFile.Length > 0 && File.Exists(soundFile)) { try { using (System.Media.SoundPlayer player = new System.Media.SoundPlayer(soundFile)) player.Play(); } catch { System.Media.SystemSounds.Exclamation.Play(); } } else { System.Media.SystemSounds.Exclamation.Play(); } }
private NotifySettings ReadSettings() { return(NotifySettings.ReadSettings()); }
private NotifySettings ReadNotificationSettings() { return(NotifySettings.ReadSettings()); }