private void btnSave_Click(object sender, EventArgs e) { dc.SetNick(tbNick.Text); dc.SetUser(tbName.Text); dc.SetColors(pbSent.BackColor, pbNames.BackColor, pbAlert.BackColor); dc.Save(); }
public void CheckName(string nick) { SavedSet.NameNotificationRow nnr; if (dc.NameNotificationList.ContainsKey(nick)) { dc.NameNotificationList.TryGetValue(nick, out nnr); if (DBNull.Value.Equals(nnr["DateOfLastActivity"])) { nnr.DateOfLastActivity = DateTime.Now; } else { //here compare now to threshhold, DateTime activity = nnr.DateOfLastActivity; int Threshold = nnr.Threshold; activity = activity.AddMinutes(Threshold); if (activity > DateTime.Now) { //if added activity time < currenttime then no need to notify, get out. nnr.DateOfLastActivity = DateTime.Now; return; } } if (nnr.WaveFile == null || nnr.WaveFile.Length == 0) { speaker.Speak(nnr.Phonetic); dc.Save(); } //else play wav file selected. nnr.DateOfLastActivity = DateTime.Now; } }
private void frmFavoriteChannels_FormClosing(object sender, FormClosingEventArgs e) { dc.Save(); }