private void CopyMessage_Click(object sender, EventArgs e) { MessageTicker.Stop(); RefreshMessage.Enabled = false; CopyMessage.Enabled = false; Clipboard.SetText(MessageDisplayTb.Text); PromptUser.Visible = true; PromptUser.Text = "Copied\r\nš¾"; Timer timer = new Timer { Interval = 1500 }; timer.Tick += (s, ee) => { PromptUser.Visible = false; PromptUser.Text = string.Empty; timer.Stop(); MessageTicker.Start(); RefreshMessage.Enabled = true; CopyMessage.Enabled = true; }; timer.Start(); }
internal void TriggerDelayedRefresh() { MessageTicker.Stop(); RefreshMessage.Enabled = false; CopyMessage.Enabled = false; PromptUser.Visible = true; int i = 0; string loading = "Loading\r\n"; Timer timer = new Timer { Interval = 375 }; timer.Tick += (s, ee) => { if (i % 2 == 0) { PromptUser.Text = $"{loading}ā³"; } else { PromptUser.Text = $"{loading}ā"; } if (i == 7) { PromptUser.Visible = false; PromptUser.Text = string.Empty; RefreshMessageDisplay(); timer.Stop(); MessageTicker.Start(); RefreshMessage.Enabled = true; CopyMessage.Enabled = true; } i++; }; _delay.SetDelay(30, new DateAndTime(TimeAndDateUtility.GetCurrentDate(), TimeAndDateUtility.GetCurrentTime())); timer.Start(); }