private void BackButton_Click(object sender, EventArgs e) { if (BackBox.Items.Count > 0) { ExcuseNotification.Text = ""; ForwardBox.Items.Add(ExcuseText.Text); ExcuseText.Text = BackBox.Items[0].ToString(); BackBox.Items.Remove(ExcuseText.Text); BackBox.EndUpdate(); ForwardBox.EndUpdate(); } }
private void ForwardButton_Click(object sender, EventArgs e) { if (ForwardBox.Items.Count != 0) { ExcuseNotification.Text = ""; BackBox.Items.Insert(0, ExcuseText.Text); ExcuseText.Text = ForwardBox.Items[ForwardBox.Items.Count - 1].ToString(); ForwardBox.Items.Remove(ExcuseText.Text); BackBox.EndUpdate(); ForwardBox.EndUpdate(); } else { ExcuseButton.PerformClick(); } }
private void RestartExcuses_Click(object sender, EventArgs e) { resetSeenExcuses(); RestartExcuses.Hide(); ExcuseText.Show(); ExcuseButton.Show(); BackButton.Hide(); ForwardButton.Hide(); ExcuseNotification.Text = ""; ExcuseText.Text = "Excuses Ahead..."; BackBox.Items.Clear(); ForwardBox.Items.Clear(); BackBox.EndUpdate(); ForwardBox.EndUpdate(); Count = 0; Settings.Default.CurrentExcuse = 0; Settings.Default.Save(); }
private void ExcuseButton_Click(object sender, EventArgs e) { if (Count > 0) { BackBox.Items.Insert(0, ExcuseText.Text); BackBox.EndUpdate(); } ExcuseNotification.ForeColor = Color.BlanchedAlmond; ExcuseNotification.Text = "Excuse #" + (Settings.Default.CurrentExcuse + 1).ToString() + "/" + TotExcuses; CopyButton.Show(); SendToEmail.Show(); BackButton.Show(); ForwardButton.Show(); string excuse = getExcuse(); ExcuseText.Text = excuse; Count += 1; ForwardBox.Items.Clear(); ForwardBox.EndUpdate(); }
private void ResetExcuses_Click(object sender, EventArgs e) { RestartExcuses.Hide(); ExcuseText.Show(); ExcuseButton.Show(); BackButton.Hide(); ForwardButton.Hide(); CopyButton.Hide(); SendToEmail.Hide(); ExcuseNotification.Text = ""; ExcuseText.Text = "Excuses Ahead..."; BackBox.Items.Clear(); ForwardBox.Items.Clear(); BackBox.EndUpdate(); ForwardBox.EndUpdate(); Count = 0; Settings.Default.CurrentExcuse = 0; for (int i = 0; i < Settings.Default.ExcuseSeen.Count; i++) { Settings.Default.ExcuseSeen[i] = "0"; Settings.Default.Save(); } Settings.Default.Save(); }